3639CH1-Fundamentals of Logic Design
3639CH1-Fundamentals of Logic Design
3639CH1-Fundamentals of Logic Design
3
4
5
6
7
8
1. (11111)2
2. (110101)2
Ans:
1. 31
2. 53
9
10
1. 1100.1011
= 8+4+0+0+0.5+0+0.125+0.0625
= 12.6875
2. 101101.10101 = ???
Ans: 45.65625
3. 0.10101 = ???
Ans: 0.65625
11
12
13
14
1. 13
2. 25
Ans:
1. 1101
2. 11001
15
16
17
18
1. 25.5
2. 10.625
Ans:
1. 11001.1
2. 1010.101
19
1. Sign-Magnitude representation
2. One’s Complement representation
3. Two’s Complement representation
20
▪ Left most bit is sign bit, remaining bits represent magnitude
of the number
▪ MSB=0 means positive
Sign Magnitude
B7 B6 B5 B4 B3 B2 B1 B0 21
Eg1: +18 = 00010010
-18 = 10010010
22
Questions Answers
1. 101100 1. -12
2. 001000 2. +8
3. 0111 3. +7
4. 1111 4. -7
23
▪ The ones' complement of a binary number is defined as the value
obtained by inverting all the bits in the binary representation of the
number (swapping 0s and 1s).
▪ The ones' complement of the number then behaves like the negative
of the original number in some arithmetic operations.
Eg: (+5) – (0101)
(-5) - (1010)
24
Eg1: (+7) – (0111)
(-7) - (1000)
Eg2: (+8) - (01000)
(-8) – (10111)
Eg3: (+15) –(01111)
(-15) – (10000)
For n-bit number, the maximum positive number which can be
represented in 1’s complement representation is (2n-1 -1) & maximum
negative number is –(2n-1 -1).
25
26
27
▪ +3 = 00000011 ▪ One representation of zero
▪ +2 = 00000010 ▪ Arithmetic works easily (see later)
▪ +1 = 00000001 ▪ Negating is fairly easy
▪ +0 = 00000000 ▪ 3 = 00000011
▪ Boolean complement gives 11111100
▪ -1 = 11111111
▪ Add 1 to LSB 11111101
▪ -2 = 11111110
▪ -3 = 11111101
28
▪ Two's complement representation uses the MSB as a sign bit.
▪ 8 bit 2s complement
▪ +127 = 01111111 = 27 -1
▪ -128 = 10000000 = -27
▪ 16 bit 2s complement
▪ +32767 = 011111111 11111111 = 215 - 1
▪ -32768 = 100000000 00000000 = -215
29
30
31
32
33
34
11001100
+ 11011010
Ans: 110100110
35
A B Sub (A-B) Borrow
0 0 0 0
1 0 1 0
1 1 0 0
0 1 1 1
36
37
38
39
40
41
10101 - 00111
▪ Take 2's complement of subtrahend 00111, which is
11001. Now, sum them. So,
▪ 10101+11001 =1 01110.
▪ In the above result, we get the carry bit 1. So we
discard this carry bit and remaining is the final
result and a positive number.
42
10101 - 10111
43
44
45
46
47
▪ The octal numeral system is the base-8 number system, and uses the digits 0 to 7.
48
49
50
▪365.24=???
Ans: 245.3125
51
52
1. 100 = ??
2. 214 = ??
Ans:
1. 144
2. 326
53
54
55
658.825 = ???
Ans:
1222.646
56
57
58
▪Convert (736)8 into an equivalent binary
number
▪Ans:
▪111011110
59
60
1. 1001110
2. 0.10100110
Ans:
1. 116
2. 0.514
61
62
63
64
65
▪ Obtain decimal equivalent of hexadecimal number
(3A.2F)
▪ Ans: 58.1836
66
67
68
Convert 95.5 into hexadecimal number.
Ans: 5F.8
69
70
71
▪ Convert 2F9A to equivalent binary
▪ Ans: 0010 1111 1001 1010
72
1. Convert the binary number 1011.01 into its equivalent decimal.
2. Convert the octal number (314)8 into its equivalent decimal.
3. Convert the octal number (365.24)8 into its equivalent decimal.
4. Convert the hex number (4C8.2)16 into its equivalent decimal.
5. Convert decimal number 105 into its equivalent binary number.
6. Convert decimal number 204 into its equivalent octal number.
7. Convert decimal number 259 into its equivalent hex number.
73
8. Convert decimal number (85.63) into its equivalent binary
number.
9. Convert decimal number (3000.45) into its equivalent octal
number.
10. Convert decimal number (2003.31) into its equivalent hex
number.
11. Convert decimal number (0.42) into its equivalent binary
number.
12. Convert decimal number (0.6234) into its equivalent octal
number.
13. Convert decimal number (0.122) into its equivalent hex number. 74