Department of Electrical & Computer Engineering
�����������������������������������������������������������
Homework 3
2.8) a.What is the largest positive number one can represent in an 8-bit 2�s complement code? Write your result in binary and decimal.
����� b. What is the greatest magnitude negative number one can represent in an 8-bit 2�s complement code? Write your result in binary and decimal.
���� c.What is the largest positive number one can represent in an n-bit 2�s complement code?
���� d. . What is the greatest magnitude negative number one can represent in an n-bit 2�s complement code?
2.11) Convert these decimal numbers to�� 8-bit 2�s complement binary numbers.
���� a. 102
���� b.�� 64
���� c. ��33
���� d. 127
2.13) Without changing their values, convert the following 2�s complement binary numbers into 8-bit 2�s complement numbers.
���� a.� 1010
���� b.� 011001
���� c.� 1111111000
���� d.� 01
2.22) Create two 16-bit 2�s complement integers such that their sum causes an overflow.
2.30) Compute the following.� Write your results in binary.
���� a.� 01010111 AND 11010111
���� b.� 101 AND 110
���� c.� 11100000 AND 10110100
���� d.� 00011111 AND 10110100
���� e.� (0011 AND 0110) AND 1101
f.� 0011 AND (0110 AND 1101)
2.36) Refer to Example 2.11 in the textbook for the following questions.
���� a.� What mask value and what operation would one use to indicate that machine 2 is busy?
���� b.� What mask value and what operation would one use to indicate that machines 2� and 6 are busy? (Note: This can be done with one operation.)
���� c.� What mask value and what operation would one use to indicate that all machines���������������� are busy?
���� d.� What mask value and what operation would one use to indicate that all machines�� ��������������are idle?
���� e.� Develop a procedure to isolate the status bit of machine 2 as the sign bit.� For example, if the BUSYNESS patter is 01011100, then the output of this procedure is 10000000.� If the BUSYNESS pattern is 01110011, then the output is 00000000. In general, if the BUSYNESS pattern is:
b7,b6,b5,b4,b3,b2,b1,b0
the output is:
b2,0,0,0,0,0,0,0.
Hint: What happens when you ADD a bit pattern to itself?
2.49)� Perform the following additions.� The corresponding 16-bit binary numbers are in 2�s complement notatin. Provide yout answers in hexadecimal.
���� a.� x025B + x26DE
���� b.� x7D96 + xF0A0
���� c.� xA397 + xA35D
���� d.� x7D96 + x7412
���� e.� What else can you say about the numbers to parts c and d?
2.50) Perform the following logical operations.� Express your answers in hexadecimal notation.
���� a.� x5478 AND xFDEA
���� b.� xABCD OR x1234
���� c.� NOT( ( NOT(xDEFA) ) AND ( NOT(xFFFF) )� )
���� d.� x00FF XOR x325C
2.51) What is the hexadecimal representation of the following numbers?
���� a.� 25,675
���� b.� 675.625 (that is 675 and 5/8ths), in the IEEE floating point standard
���� c.� The ASCII string: Hello
2.54) Fill in the truth table for the equation given.� The first line is don as an example.
Q1 = NOT (A AND B)
Q2 = NOT ( NOT(A) AND NOT(B) )
|
A |
B |
Q1 |
Q2 |
|
0 |
0 |
1 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|