Signed Multiplier & Comparator: Arush Sharma

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

ECN 252

Digital Electronic Circuits Lab

Lab 6
SIGNED MULTIPLIER &
COMPARATOR
___
Arush Sharma
19116011
B.Tech ECE 2023

Part 1 :
“Understand the operation of signed multiplier (2’s complement form) and
implement the Bough-Wooley multiplier circuit. Test the circuit with given input
combinations – see table below. (Bough-Wooley scheme will be explained during
tutorial, also see link below for a nice tutorial)”
2

Schematic :-

Results of simulation for


Set 4 : -2 and - 5 : We take the inputs as 2’s complement form.
I.e. 1110 and 1011
We also take Vadd as the value of 1 that we add in the circuit
3

As we can see, the output is :- (00001010)2 which is equal to (10)10. Hence it is verified.
4

Part 2 :
“Design a 4-bit comparator following the circuit in Section 4.8, Digital Design Book by
Morris Mano.

(Relevant book pages will be posted on Teams, explained during the tutorial). Compare any
two numbers to check that your design is working properly. Does this scheme work for signed
integers in 2’s complement form? If not, what changes do you need to make in the circuit to
make it work for signed integers?”
5

Schematic:-
6

Testing it on different inputs:-


Test case 1 :
A = 1111 B = 1111

Result : A == B

Test case 2 :
A = 1011 B = 0101

Result : A > B

Test case 3 :
A = 1011 B = 1101
7

Result : A < B
8

Now, this does not work for signed integers in 2’s complement form, however, we can slightly
change our circuit to allow for this change.

For this, let us take a bit which will denote whether or not we want to use our comparator for
signed numbers, and call it the Sign bit

We will modify such that we will take a XOR of the Sign bit with the MSB’s of A and B each.

Now, when this Sign bit is off, our comparator will act in such a way that it treats the numbers
as unsigned.

However, when the Sign bit is ON, both the MSB’s of our numbers are inverted since taking XOR
with 1 inverts a bit. This is in a way similar to adding 8 (i.e. 2^3) to our numbers, which would
give us the same result while also allowing us to compare these signed numbers.

Hence, we will be able to compare even signed numbers.

You might also like