0% found this document useful (0 votes)
21 views6 pages

EC Tutorial4 Solutions

This document discusses binary arithmetic and boolean algebra. It contains 10 questions that cover: [1] converting between decimal and binary numbers, [2] binary arithmetic operations like addition and subtraction, [3] boolean expressions and logic gates, [4] truth tables, and [5] simplifying boolean expressions. The questions provide examples and exercises in working with and representing numeric and logical operations using binary numbers and boolean algebra.

Uploaded by

nabeelbird
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
21 views6 pages

EC Tutorial4 Solutions

This document discusses binary arithmetic and boolean algebra. It contains 10 questions that cover: [1] converting between decimal and binary numbers, [2] binary arithmetic operations like addition and subtraction, [3] boolean expressions and logic gates, [4] truth tables, and [5] simplifying boolean expressions. The questions provide examples and exercises in working with and representing numeric and logical operations using binary numbers and boolean algebra.

Uploaded by

nabeelbird
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

Electronic Section (Digits)

Question 1

Convert the following decimal numbers to binary numbers. Show your work.

a) 10
b) 20
c) 50

a)

This is achieved by repetitive division with 2

10 div 2 = 5 rem 0
5 div 2 = 2 rem 1
2 div 2 = 1 rem 0
1 div 2 = 0 rem 1

Hence, the binary number is 1010

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

Hence the binary number is 10100

c) compute with similar division as above

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)

110011=1 x 25 +1 x 24 +0 x 23 +0 x 22+1 x 21 +1 x 20 =51

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

Obtain the 2's complement of the following binary numbers

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)

Find the one's complement – 0101 becomes 1010.


Then add 1

1010+
1=
1011

c)

Find one's complement of 0001 – becomes 1110


Then add 1 = 1111
Question 4
Compute the following operations using binary arithmetic

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

Similar addition is to be used for (b) and (c).

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

Show the truth table of the following boolean expressions

a) Y = A+( B+C)+ BC

b) Y = A+( B̄+ C̄)+ B̄ C

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)

A B C B' C' B'+C' B'C Y=A+(B'+C')+B'C


0 0 0 1 1 1 0 1
0 0 1 1 0 1 1 1
0 1 0 0 1 1 0 1
0 1 1 0 0 0 0 0
1 0 0 1 1 1 0 1
1 0 1 1 0 1 1 1
1 1 0 0 1 1 0 1
1 1 1 0 0 0 0 1
Question 7

Construct logical circuits for the following boolean expressions.

a) Y = A B̄ C+ ABC +(C + D)( D̄+ E)

b) Y = A+( B+C)+ BC

The logical circuit of (a) is shown in the class notes.

The logical circuit of (b) is left as an exercise.

Question 8

Show the logical circuits of the boolean expressions in the previous example with NAND
gates only.

This is left as an exercise.

Question 9

Simplify the following boolean expressions

a) Y = A B̄ C+ ABC +(C + D)( D̄+ E)

b) Y = A+(B+C)+ BC

c) Y = A+( B̄+ C̄)+ B̄ C

c) Y =( A + B)(B+C)

a)

Y = A B̄ C+ ABC +(C+ D)( D̄+ E)


= AC ( B̄+ B)+C D̄+CE+ D D̄+ D E
= AC (1)+C D̄+CE+0+ D E
= AC+C D̄+CE+0+ D E
=C (A + D̄+E)+D E
b)

Y = A+(B+C)+BC
= A+ B+C (1+B)
= A+B+C (1)
= A+ B+C

c)

Y = A+( B̄+ C̄)+ B̄ C


= A+ B̄(1+C)+ C̄
= A+ B̄(1)+ C̄
= A+ B̄+ 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.

This is left as an exercise.

You might also like