Question: There are two 4 - bit unsigned values A ( A 3 A 2 A 1 A 0 ) and B ( B 3 B

There are two 4-bit unsigned values A(A3A2A1A0) and B(B3B2B1B0) provided as input with a
maximum value of 7. So A3 and B3 will be 0.
The objective of this homework is to determine the equations for two output bits ZF and SF.
The ZF bit should be 1 if A==B. The SF bit should be 1 if B>A.
The homework can be broken down into the following steps:
Calculate the equations for determining the 1's complement of B. The inputs of this step
are B3B2B1B0 and the outputs of this step are O3O2O1O0. Hint: O0 only depends on B0,O1
only depends on B1, etc. It is not necessary to do truth table.
Calculate the equations for determining -B. This is the 2's complement of B. The inputs of
this step are O3O2O1O0 and the outputs of this step of N3N2N1N0. The 2's complement of a
number is found by adding 1 to the 1's complement of the number. So we are adding
O3O2O1O0 and 0001. Refer to the below table from the first lecture about adding 2 numbers.
For the first bit, the input A in the table is O0 and the input B in the table is 1. The sum is N0.
N0 is 1 if O0 is 0. The carry-out C1 is 1 if O0 is 1. For the second bit, the input A in the table
is O1 and the input B in the table is C1. The sum is N1*N1 is 1 if O1C1'+O1'C1.C2 is 1 if
O1C1. Similarly, calculate the equations for N2,C3,N3. The equations can be left as function
of the inputs of this step (O3O2O1O0); it is not necessary to calculate them as function of B
(B3B2B1B0).
 There are two 4-bit unsigned values A(A3A2A1A0) and B(B3B2B1B0) provided as

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!