Creating a circuit to find the absolute value of a number

Thread Starter

bcurneen

Joined Apr 19, 2009
1
This is one of the questions on my homework assignment. I need to find the absolute value of a 4-bit binary number. I know that I don't need to do anything to the first 8 positive numbers to find the absolute value, but my problem is with the last 8 negative numbers. I know that I need to use two's complement to invert the bits and then add one. I am required to use four full adders, four multiplexers, and four inverters.

Thanks for any help
 

PRS

Joined Aug 24, 2008
989
It's been a long time since I've done these kinds of problems, but I can suggest a start: Use the inverters to get the 2's compliment then an adder to add 1. I'll sleep on the rest of it. Unfortunately I no longer have my Digital Logic book.
 

Papabravo

Joined Feb 24, 2006
22,115
I think you can use inverters to load a counter and clock it one time only. Then you have to examine the most significant bit of the orginal number and the 2's complement to see which one should be passed via a mux to the output.
 
Top