Lecture 1
Lecture 1
Lecture#1
Instructor: Syed Muhammad Usman
Quizzes (14%)
- 4 (Announced/ Unannounced) quizzes
Final (40%)
2 Digital Systems
• Digital systems represent information using a
binary system, where data can assume one of only two
possible values:
• zero or one.
• These gates are the AND, OR, NOT, NAND, NOR, XOR and
XNOR gates.
NOT gate
Binary Subtraction
• Subtraction and Borrow, these two words will be used
very frequently for the binary subtraction.
10
Binary Multiplication
• Binary multiplication is similar to decimal multiplication.
• It is simpler than decimal multiplication because only 0s
and 1s are involved.
11 Number System
Example:
13 Octal Number System
Example:
14 Decimal Number System
Decimal numbers uses digits from 0 to 9.
Example:
15 Hexadecimal Numbers
Hex numbers uses digits from 0 to 9 and A to F.
Example:
16 Number System Conversion Table
DecimalBase- HexadecimalBas
BinaryBase-2 OctalBase-8
10 e-16
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
17 Decimal to Other Base System
•Step 1 − Divide the decimal number to be converted by the value of
the new base.
•Step 2 − Get the remainder from Step 1 as the rightmost digit (least
significant digit) of new base number.
•Step 3 − Divide the quotient of the previous divide by the new base.
•Step 4 − Record the remainder from Step 3 as the next digit (to the
left) of the new base number.
Repeat Steps 3 and 4, getting remainders from right to left, until the
quotient becomes zero in Step 3.
The last remainder thus obtained will be the Most Significant Digit
(MSD) of the new base number.
18 Example
Decimal Number: (29)10
Step 1 29 / 2 14 1
Step 2 14 / 2 7 0
Step 3 7/2 3 1
Step 4 3/2 1 1
Step 5 1/2 0 1
19 Cont.
As mentioned in Steps 2 and 4, the remainders have to be
arranged in the reverse order so that the first remainder
becomes the Least Significant Digit (LSD) and the last
remainder becomes the Most Significant Digit (MSD).
4 3 2
Step 111012 ((1 × 2 ) + (1 × 2 ) + (1 × 2 )
1 0
1 + (0 × 2 ) + (1 × 2 ))10
4 3 2
Step 11101 ((1 × 2 ) + (1 × 2 ) + (1 × 2 )
1 0
1 + (0 × 2 ) + (1 × 2 ))
Step 11101 29
3
1 0
Step 1 25 ((2 × 8 ) + (5 × 8 ))
Step 2 25 (16 + 5 )
Step 3 25 21
Step 3 15 00010101
Octal: 0 1 2 3 4 5 6 7
Binary
001 010 001 011 011 110
=
=
Octal
1 2 1 3 3 6 121336
=
octal
Drop any leading zeros or pad with leading zeros to get groups
of four binary digits (bits):
Binary 011100101 = 1110 0101
1111111
-1010110
Answer ???
34 Two’s complement
Answer??