Sheet 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Alexandria University Introduction to logic circuits

Faculty of Engineering Course Code: EEE 141


EEE and EEP programs Lecturer: Karim Banawan
First Year TAs: Menna Said
Academic Year: 2019-2020 Problem Set: 2
Problem Set (2)
Introduction to Number Systems and Codes
1. Convert each pair of decimal numbers to binary and add using the 2’s complement form:
(a) 33 and 15 (b) 246 and 25 (c) 2110 and 284
2. Perform each addition in the 2’s complement form:
(a) 00010110 + 00110011 (b) 01110000 + 10101111
3. Perform each subtraction in the 2’s complement form:
(a) 00110011 - 00010000 (b) 01100101 - 11101000
4. Multiply 01101010 by 11110001 in the 2’s complement form.
5. Divide 10001000 by 00100010 in the 2’s complement form.
6. Convert each hexadecimal number to binary:
(a) 4616 (c) B416 (c) ABCD16
7. Convert each binary number to hexadecimal:
(a) 10101010 (b) 10101100 (c) 10111011
8. Convert each hexadecimal number to decimal:
(a) 2B16 (b) BC16 (c) ABC16
9. Convert each decimal number to hexadecimal:
(a) 15 (b) 54 (c) 3652
10. Perform the following:
(a) 2516 + 3316 (b) A416 + F516 (c) A516 - 9816 (d) AC16 - 1016
11. Convert each octal number to decimal:
(a) 148 (b) 77778 (c) 26738
12. Convert each decimal number to octal by repeated division by 8:
(a) 65 (b) 84 (c) 156
13. Convert each octal number into binary:
(a) 268 (b) 1458 (c) 4568
14. Convert each binary number to octal:
(a) 110011 (b) 101010 (c) 10101111
15. Convert each of the following decimal numbers to 8421 BCD:
(a) 21 (b) 125 (c) 156
16. Convert each of the BCD numbers to decimal:
(a) 011101010100 (b) 0001011010000011 (c) 1001000000011000
17. Add the following BCD numbers:
(a) 00100101 + 00100111 (b) 01010001 + 01011000 (c) 010101100001 + 011100001000
18. In a certain application a 4-bit binary sequence cycles from 1111 to 0000 periodically. There
are four bit changes, and because of circuit delays, these changes may not occur at the same
instant. For example, if the LSB changes first, the number will appear as 1110 during the
transition from 1111 to 0000 and may be misinterpreted by the system. Illustrate how the
Gray code avoids this problem.
19. Convert each binary number to Gray code:
(a) 11011 (b) 1001010 (c) 1111011101110
20. Convert each Gray code to binary:
(a) 1010 (b) 00010 (c) 11000010001
21. Decode the following ASCII coded message:
1001000 1100101 1101100 1101100 1101111 0101110 0100000 1001000 1101111
1110111 0100000 1100001 1110010 1100101 0100000 1111001 1101111 1110101
0111111
22. Determine which of the following even parity codes are in error:
(a) 100110010 (b) 011101010 (c) 10111111010001010
23. Determine which of the following odd parity codes are in error:
(a) 11110110 (b) 00110001 (c) 01010101010101010
24. Attach the proper even parity bit to each of the following bytes of data:
(a) 10100100 (b) 00001001 (c) 11111110
25. Convert to base 6: 3BA.2514 (do all of the arithmetic in decimal).
26. A computer has a word length of 8 bits (including sign). If 2’s complement is used to
represent negative numbers, what range of integers can be stored in the computer? If 1’s
complement is used? (Express your answers in decimal.)
27. Construct a table for 7-3-2-1 weighted code and write 3659 using this code.
28. Assume three digits are used to represent positive integers and also assume the following
operations are correct. Determine the base of the numbers. Did any of the additions
overflow?
a) 654 +013=000
b) 024 +043 +013 + 033=223
c) 024 +043 + 013+ 033= 201
29. Is it possible to construct a 5-3-1-1 weighted code? A 6-4-1-1 weighted code? Justify.
30. The solutions to the quadratic equation are and . What is the
base of the number system.
31. Convert decimal 8.723 to both BCD and ASCII codes. For ASCII, an even parity bit is to be
appended to the left.
32. The state of a 12-bit register is 100010010111. What is the content if it represents:
a. Three decimal digits in BCD.
b. Three decimal digits in excess-3 code.
c. Three decimal digits in the 84-2-1 code.
d. Binary number?

You might also like