Number System
Number System
Base or Radix
• Binary 2
• Octal 8
• Decimal 10
• Hexadecimal 16
Number System Conversion
• Category 1: Decimal to Any Base
Example:
Convert the decimal number 2610 into its binary equivalent.
2610 = 110102
Dec → Binary : More Examples
a) 1310 = ?
b) 2210 = ?
c) 4310 = ?
d) 15810 = ?
5
Dec → Binary : More Examples
a) 1310 = ? 11012
b) 2210 = ? 101102
c) 4310 = ? 1010112
d) 15810 = ? 100111102
6
Category 1: Decimal to Any Base
Example:
Convert the decimal number 2610 into its Octal equivalent.
2610 = 328
Dec → Octal : More Examples
a) 1310 = ?
b) 2210 = ?
c) 4310 = ?
d) 15610 = ?
8
Category 1: Decimal to Any Base
Example:
Convert the decimal number 2610 into its Hexadecimal equivalent.
2610 = 1A16
Dec → Hexadecimal : More
Examples
a) 1310 = ?
b) 2210 = ?
c) 4310 = ?
d) 15610 = ?
10
Category 2: Any Base to Decimal
Example:
Convert the Binary number 110102 into its decimal equivalent.
110102 = 2610
Bin → Decimal : More Examples
11012 =
1 0 1 1 0 2=
1010112 =
100111102 =
12
Category 2: Any Base to Decimal
Example:
Convert the Octal number 328 into its decimal equivalent.
328 = 2610
Octal → Decimal : More Examples
11 8 =
16 8=
24 8 =
568 =
14
Category 2: Any Base to Decimal
Example:
Convert the Octal number 1A16 into its decimal equivalent.
1A16 = 2610
Hexadecimal → Dec : More
Examples
a) 2316 = ?
b) 5B16 = ?
c) 4A16 = ?
d) 15616 = ?
16
Category 3: Any Base to Any Base
(Excluding Category 1 & 2 cases)
Example 3:
(224)5 = ( ? )7
Solution: (121)7
Number System Conversions
• Convert (0.3125)10 into its binary equivalent.
Number System Conversions
• Convert (0.3125)10 into its octal equivalent.
Number System Conversions
• Convert (0.3125)10 into its hexadecimal equivalent.
Signed Magnitude Form
Left Most Bit in a signed number is Sign Bit
Solution::
a)
b)
Subtraction using Complements
Rules::
If carry generated Result is positive and If carry generated Result is positive and
add the carry to least significant position discard carry
Examples
CODES
2421 Code
CODES
Dec. 8421 2421 631-1 Excess-3
(BCD code) (Self complementary) (Self complementary) (Add 3 to BCD)
0 0000 0000 0000; 0011 0011
1 0001 0010
0001 0100
2
0010; 1000 0101
0010 0101
0011; 1001 0100; 0111
3 0011 0110
0100; 1010 0110
4 0100 0111
0101; 1011 1001
5 0101 1000
0110; 1100 1000; 1011
6 0110 0111; 1101 1010 1001
7 0111 1110 1101 1010
8 1000 1111 1111; 1100 1011
9
1001 1100
BCD Code
• It is a way to express each of the Decimal Digits with a Binary Code
Binary 1 0 1 1 0
Gray
Convert Binary into Gray Codes
Gray 1 0 1 1 0
Binary
Gray Code Sequence: 2 bit, 3 Bit, 4
Bit
Error Detection & Correction Method
• Parity Method
• Hamming Code
What is Parity???
• It is concept of detecting error.
Tx Rx
• We need to add 1 extra bit (i.e. Parity Bit) along with the original information.
Types
Even parity Odd Parity
2P≥P+n+1
7 6 5 4 3 2 1
D3 D2 D1 P3 D0 P2 P1
D3 D2 D1 D0
MSB LSB
Step 3: Value of Parity Bits
P1 – 3,5,7
P2 – 3,6,7
P3 – 5,6,7
7 6 5 4 3 2 1
D3 D2 D1 P3 D0 P2 P1
7 6 5 4 3 2 1
D3 D2 D1 P3 D0 P2 P1
Create Hamming code for Data bits
10110 using odd parity.
BOOLEAN ALGEBRA & BOOLEAN
EXPRESSIONS
AND Gate- Application
Practice Questions
Identify the logic gate from Timing
Diagram
Laws of Boolean Algebra
• Commutative Law
• Associative Law
Rules of Boolean Algebra
Verification of Rule 11
Verification of Rule 12
Demorgan’s Theorems
• First Theorem::
Demorgan’s Theorems
• Second Theorem::
Practice Problems
Practice Problems
Solution
Boolean Expression
Constructing Truth Table for Boolean expression
Hardware Reduction
Homework