0% found this document useful (0 votes)
299 views4 pages

Tutorial 1.2 Solution-Benm 1143 Logic Circuit

This document provides solutions to tutorial questions on logic circuits. It covers binary operations like 1's and 2's complement, conversions between binary, decimal and BCD, arithmetic operations, error detection codes and other digital logic concepts. Some of the key topics covered include signed number representations, addition/subtraction of binary and BCD numbers, gray coding, ASCII encoding, parity checking and error detection.

Uploaded by

Ammar Al-Hejazi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
299 views4 pages

Tutorial 1.2 Solution-Benm 1143 Logic Circuit

This document provides solutions to tutorial questions on logic circuits. It covers binary operations like 1's and 2's complement, conversions between binary, decimal and BCD, arithmetic operations, error detection codes and other digital logic concepts. Some of the key topics covered include signed number representations, addition/subtraction of binary and BCD numbers, gray coding, ASCII encoding, parity checking and error detection.

Uploaded by

Ammar Al-Hejazi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

BENM 1143

LOGIC CIRCUITS (BENM 1143)


TUTORIAL 1.2 (SOLUTION)
1.

Determine the 1s complement of each binary number


a) 1010 = 0101

c) 1110101 = 0001010

b) 11010111 = 00101000
2.

d) 00001 = 11110

Determine the 2s complement of each binary number


a) 1101 = 0010 + 1 = 0011

c) 10110000 = 01001111 + 1 = 01010000

b) 10011 = 01100 + 1 = 01101 d) 00111101 = 11000010 + 1 = 11000011


3.

4.

5.

6.

Express each decimal number in binary as an 8-bit sign-magnitude number:


a) +29 = 00011101

b) -85 = 11010101

c) +100 = 01100100

d) -123 = 11111011

Express each decimal number in binary as an 8-bit number in the 1s complement form:
a) -34 = 11011101

b) +57 = 00111001

c) -99 = 10011100

d) +115 = 001110011

Express each decimal number in binary as an 8-bit number in the 2s complement form:
a) +12 = 00001100

b) -68 = 10111011 + 1 = 10111100

c) +101 = 01100101

d) -125 = 10000010 + 1 = 10000011

Determine the decimal value of each signed binary number in the sign-magnitude form:
a) 10011001 = - (16 + 8 +1) = -25

b) 01110100 = +116

c) 10111111 = - (32+16+8+4+2+1) = -63


7.

Determine the decimal value of each signed binary number in the 1s complement form:
a) 10011001 = (-128 + 16 + 8 + 1) +1 = -102
b) 01110100 = + 116
c) 10111111 = (-128 +32+ 16+8+4+2+1) + 1 = -64

8.

Determine the decimal value of each signed binary number in the 2s complement form:
a) 10011001 = -128 + 16 + 8 + 1 = -103
b) 01110100 = +116
c) 10111111 = -128 + 32 + 16 + 8 + 4 + 2 + 1 = -65

9.

Convert each pair of decimal numbers to binary and add using the 2s complement forms:
(using hardware subtract execution for the negative number only)
a) 33 and 15
+33 = 00100001 , +15 = 00001111
00100001 + 00001111 = 00110000
b) 56 and -27
+56 = 00111000 , -27= 11100100 + 1 = 11100101
00111000 + 11100101 = 100011101

Zarina/Niza/K.g

BENM 1143

c) -46 and 25
-46 = 11010001 + 1 = 11010010 , +25 = 00011001
11010010 + 00011001 = 11101011
d)

-110 and -84


-110 = 10010001 + 1 = 10010010 , -84 = 10101011 + 1 = 10101100
10010010 + 10101100 = 1 00111110 ( OVERFLOW)

10.

Perform each of the following subtractions of the signed numbers (using hardware
subtract execution for the negative number only by 2s complement):
a) 00001001 00000100
00000100 change to 2s complement = 11111011 + 1 = 11111100
00001001 + 11111100 = 1 00000101 = 00000101
b) 11101000 - 00010100
00010100 change to 2s complement = 11101011 + 1 = 11101100
11101000 + 11101100 = 1 11010100
c) 00001011 11110110
11110110 change to 2s complement = 00001001 + 1 = 00001010
00001011 + 00001010 = 00010101
d)

10000111 11100001
11100001 change to 2s complement = 00011110 + 1 = 00011111
10000111 + 00011111 = 10100110

11.

Multiply the signed binary numbers: 01101010 (multiplicand) and 11110001(multiplier).


(this question not in syllabus)

12.

Divide 00110000 by 00001100 = Answer: 100

13.

Convert each of the BCD numbers to decimal:

14.

a) 0001 1000 = 1810

c) 1000 0111 0000 = 87010

b) 1001 0000 0001 1000 = 901810

d) 0110 0110 0110 0111 = 666710

Add the following BCD numbers:


a) 0001 1000 + 0001 0001 = 0010 1001BCD
b) 0101 0110 0001 + 0111 0000 1000 = 0001 0010 0110 1001BCD
c) 01100100 + 00110011 =

d) 10011000 + 10010111 =

Zarina/Niza/K.g

BENM 1143

15.

Covert each pair of decimal numbers to BCD, and add as indicated:


a) 65 + 58 = 0001

0010

0011BCD

0110

0101

65

0101

1000

58

1011

1101

+ 0110 +0110
0001

0010

0011

Both groups are invalid (>9)

123

Add 6 to both groups


Valid BCD number

b) 17 + 12 = 0010 1001BCD

c) 113 + 101 = 0010 0001 0100BCD

d) 295 + 157 = 0100 0101 0010BCD


16.

Convert each binary number to gray code:


a) 10011001 = 110101101

17.

b) 000100 = 000111

c) 11000010001= 10000011110

Determine each ASCII character. Refer to Table 1


a) 0011000 = CAN = 24 =18

19.

c)10111111 = 11100000

Convert each Gray code to binary number:


a) 11001 = 10001

18.

b) 01110100 = 01001110

b) 0111110

c) 1000010

Convert to the following computer program statement to ASCII


30 INPUT A,B
SYMBOL

BINARY

HEX

0000011

03

0000000

00

space

0100000

20

I
N
P
U
T
space
A
,
B

Zarina/Niza/K.g

BENM 1143

20.

Determine which of the following even parity codes are in error


a) 100110010

b) 011101010 error

c) 10111111010001010
21.

Determine which of the following odd parity codes are in error


a) 11110110 - error

22.

b) 00110001

c) 010101010101010

An even parity system receives the following code groups: 1011, 11011, 1101110,
1110100, 10010111001, 101011101011 and 11000101010101.

Determine which

groups, if any, are in error.


Answer: 1011, 1101110, 11000101010101
23.

Assign the proper odd parity bit to the following code groups
a) 1010 11010 (add 1 at the right most)
b) 111000 0111000 (add 0 at the right most)
c) 101101011111 0101101011111 (add 0 at the right most)

Zarina/Niza/K.g

You might also like