Homework 1

EECS 284
Posted: January 14, 2000
Due: January 20, 2000
 

Learning objectives

 Homework guidelines

 
1
6 points
a) Assume that there are 49 students in your class. If every student is to be assigned a unique bit pattern, what is the minimum number of bits required to do this? 

b) How many more students can be added to the class without requiring additional bits for the unique pattern? 
 


2
8 points


a) What is the largest positive number one can represent in a 16-bit two’s complement code? Write your result in binary and decimal. 

b) What is the greatest magnitude negative number one can represent in 16-bit two’s complement code? Write your result in binary and decimal. 

c) What is largest positive number one can represent in n-bit two’s complement code? 

d) What is greatest magnitude negative number one can represent in n-bit two’s complement code? 


3
16 points


Add the following unsigned binary numbers. Complete the addition in binary and express the answers in hexadecimal. For each addition, indicate whether the operation resulted in overflow. 
    a)  01011010 + 01110110 
    b)  11010011 + 00110111 
    c)  01110111 + 01111100 
    d)  01100110 + 10101010

4
12 points


Compute the following logical operations.  Show the results in binary and hexadecimal. 
a)  NOT(NOT(1001)) AND NOT(1101) 
b)  (NOT(1100) AND NOT(1001)) OR 0101 
c)  NOT (1101 AND NOT(0001)) 
d)  NOT(((0101 OR 1100) OR 0001) AND 1001)

5
16 points


For each of the following 16-bit hexadecimal value show in decimal its value if interpreted as unsigned, sign-magnitude, one's complement, and two’s complement integers. 
 
hex unsigned sign-magnitude one's complement two's complement
xFABD        
x1001        
x20A1        
xEA00        
 

6
16 points


Perform the following additions. Provide your answers in hexadecimal. Point out which operations result in  overflow if (i) the operands are unsigned integers and (ii) the operands are two's complement integers. 
    a)  x057E + x26CD  
    b)  xAC01 + xE1BD  
    c)  x6CA1 + x5B9D  
    d)  xABCD + x099E

7
6 points


 Complete the truth table for the equations given below. The first line is done as an example:  Q1 = NOT (A OR B)  
Q2 = (A OR B) AND NOT (A)  
Q3 = NOT((A OR B) AND NOT (A AND B))
 
A B Q1 Q2 Q3
0 0 1 0 1
         
         
         
         
         
         
         
 

8
12 points


Fill in the truth table for the equations given below. The first line is done as an example:  Q1 = NOT(NOT(X) OR NOT(X AND Y AND Z))  
Q2 = (Y OR Z) AND (Z OR X) AND (X AND Y AND Z)
 
X Y Z Q1 Q2
0 0 0 0 0
         
         
         
         
         
         
         
 

9
8 points


Recall that the two-input XOR function (where C = XOR(A, B) = A XOR B) can be described by the following truth table: 
 
A B C
0
0
0
0 1 1
1 0 1
1 1 0
Using the procedure with which we proved the logical completeness of the set of gates {AND, OR, NOT}, construct a circuit that implements C = A XOR B.