EC Tutorial4 Solutions
EC Tutorial4 Solutions
Question 1
Convert the following decimal numbers to binary numbers. Show your work.
a) 10
b) 20
c) 50
a)
10 div 2 = 5 rem 0
5 div 2 = 2 rem 1
2 div 2 = 1 rem 0
1 div 2 = 0 rem 1
b)
20 div 2 = 10 rem 0
10 div 2 = 5 rem 0
5 div 2 = 2 rem 1
2 div 2 = 1 rem 0
1 div 2 = 0 rem 1
Question 2
Convert the following binary numbers to decimal numbers. Show your work.
a) 1000
b) 110011
c) 00110010
This requires that one number the bits from right to left
a)
3 2 1 0
1000=1 x 2 +0 x 2 +0 x 2 + 0 x 2 =8
b)
c)
7 6 5 4 3 2 1 0
00110010=0 x 2 + 0 x 2 +1 x 2 +1 x 2 +0 x 2 + 0 x 2 +1 x 2 + 0 x 2 =50
Question 3
a) 0011
b) 0101
c) 0001
The 2's complement requires one first invert the bits and then add 1.
a)
Find the one's complement (invert all bits) - 0011 becomes 1100
Then add 1.
1100+
1=
1101
b)
1010+
1=
1011
c)
a) 20 – 10
b) 15 – 10
c) 30 – 15
a)
From the previous example 1(a), the binary number of 20 is 10100.
The binary number of 10 is 01010. Since the number 10 is to be subtracted, this has to be
represented as negative number which is found with the two's complement.
Hence, the one's complement of 01010 is 10101. the two's complement is 10110 (=10101+1).
Add as follows
10100+
10110=
01010
Question 5
Show the representation of the decimal numbers from -8 to +7 with binary numbers. Show the
resulting binary numbers in a table.
7 0111
6 0110
5 0101
4 0100
3 0011
2 0010
1 0001
0 0000
-1 1111
-2 1110
-3 1101
-4 1100
-5 1011
-6 1010
-7 1001
-8 1000
Question 6
a) Y = A+( B+C)+ BC
a)
A B C B+C BC Y=A+(B+C)+BC
0 0 0 0 0 0
0 0 1 1 0 1
0 1 0 1 0 1
0 1 1 1 1 1
1 0 0 0 0 1
1 0 1 1 0 1
1 1 0 1 0 1
1 1 1 1 1 1
b)
b) Y = A+( B+C)+ BC
Question 8
Show the logical circuits of the boolean expressions in the previous example with NAND
gates only.
Question 9
b) Y = A+(B+C)+ BC
c) Y =( A + B)(B+C)
a)
Y = A+(B+C)+BC
= A+ B+C (1+B)
= A+B+C (1)
= A+ B+C
c)
d)
Y =( A + B)(B+C)
= AB+ AC + BB+ BC
= AB+ AC +B+BC
=B( A+1+C)+ AC
=B+ AC
Question 10
For the previous example, construct the logical circuits for the simplified and non-simplified
expressions.