Bit-Sliced Absolute Value Logic |―|

Thread Starter

Brettjohnson7191

Joined Apr 28, 2022
23
Hello all,
I have an assignment that I am working on right now for VLSI that requires us to build a circuit using |―| principal. The first stage of the assignment is to build a single bit block that is able then to link up with more of its kind to form a 4 bit absolute value subtractor circuit. Our hint was to design a comparator followed by a subtraction circuit. I have designed both a comparator and a half subtractor. However, I am stuck on how to sort the data using the comparator. I attached my truth table for both. I need to be able to send the highest bit between the two numbers to A input of the subtractor and the lowest bit to B input of the subtractor. Right now, my comparator just tells if A is bigger smaller or equal to B.
If someone can help point me in the right direction it would be really appreciated!
Thank you guys so much!
 

Attachments

WBahn

Joined Mar 31, 2012
27,880
I'm not sure what you mean by " |―| principal". Could you describe that -- it's probably just a matter of a terminology difference.

Your circuit diagram had FETs that are diode-connected. Why? What purpose do they serve?

What is an "absolute value subtractor"? I see three reasonable possible definitions:

z = |x - y|

or

z = |x| - |y|

or

z = | |x| - |y| |

These are three very different functions.

How are the 4-bit input values that are being represented? Are they unsigned integers (straight binary)? Are they signed integers (if so, are they two's complement, one's complement, signed binary, offset binary)?
 

Thread Starter

Brettjohnson7191

Joined Apr 28, 2022
23
Sorry I should have given more details.
1. In the end we need to be able to have our circuit subtract two 4bit positive binary numbers.
2. the |___| is just referring to the fact that we always want to subtract the smaller number B from the larger number A.
3. you can ignore that top schematic that was a previous attempt but that was a unit inverter in the schematic not a diode I should have cropped that section off.

So, we first make a AVNn block that is capable of subtracting two one-bit positive numbers. This AVNn block will then be cascaded to form the logic to correctly subtract out two 4bit positive binary numbers. I have attached my second attempt from early today that appears to correctly sort out the max and min values correctly into the half subtractor. Which in turn will spit out our difference and borrow, now I am stuck on the idea of how the borrow will link back into the next comparator or subtractor.
hopefully this makes it a little clearer, I apologize for the confusion.
 

Attachments

WBahn

Joined Mar 31, 2012
27,880
You can't do your logic one bit at a time (at least not the way you seem to be approaching the problem).

Let's consider normal four-digit base-10 numbers to see what the issue is.

Consider A=3456 and B=6543

What you WANT is a result that says, since B is greater than A, the result is 6543-3456 which is 3087

But you seem be wanting to approach things one digit at a time, so starting from the right, you say that 6 is greater then 3, so subtract 3 from 6. Regardless of what else happens, that would make the least-significant-digit of the result a 3 and not a 7.

Also, look at the truth table you present for your min and max values -- it shows that max is always equal to A and min is always equal to B. Does that make sense? What does it mean for max to be 0 at the same time that min is 1?
 

Thread Starter

Brettjohnson7191

Joined Apr 28, 2022
23
I see what your saying now as my issue. I remember the professor in class saying we needed to do the subtraction backwards(from Left to Right, I think. He also said we will need to do a full comparison before subtraction. So like you said I will need a way to determine which of the two numbers is greater and then proceed with the subtraction. As for my truth table I agree that's not right I guess I need to start over back from scratch.

So my first comparator I built for this assignment was able to input two numbers and then had three outputs if A<B, A=B or A>B. This would tell us if we are going from left to right which of the two numbers is larger. However I am unaware that we can do binary subtraction from left to right.
I am still hung up as in the assignment he says build AVN1 slice logic without the need of any other glue logic so that we can connect n number of AVN1 logic blocks to make AVN4 for 4 bit subtraction. That is why I keep trying to do it bit by bit in my above posts as this is still step 1 where we are building AVN1 for single bit subtraction.
 

Thread Starter

Brettjohnson7191

Joined Apr 28, 2022
23
Could I just take two full subtractors do A-B in one B-A in the other then run a comparator to check to see if A<b or B<A and send all three of these outputs to a 2:1 MUX to select the proper subtraction and output it?
 

WBahn

Joined Mar 31, 2012
27,880
I've never heard of an "AVNn" block, so I don't know what, exactly, it is you are being asked to do.

But, reading between the lines, it sounds like you are expected to create a logic block that operates on one bit from each value and outputs the value for the corresponding bit in the result. If done correctly, you should have a black box such that you simply wire up four of them for a four-bit number without using any other logic gates.

So consider the following:

abCd // One of the four-bit input values
efGh // The other four-bit input value.
pqRs // The four-bit result.

You want to design a logic block that takes C and G as inputs (and possibly inputs from adjacent blocks) and outputs R (and possible outputs to adjacent blocks).

So what information, other than C and G, you need in order to know what R is? What information has to come from the left? What information has to come from the right?
 
Top