Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Logic Gates and Full Adders

Name: Anonymous 2011-08-21 16:25

Greetings /prog/

I admittedly haven't been here before, haven't even been to this site but I was lingked here from /g/ so... I was wondering if you could give me a hand with something. I'm a first year computer science student (I know I know there's no jobs and it's a waste of time and whatever) and I was looking through some past papers when I came across a question that has me a little perplexed.

The question asked how I would go about building a denary full adder using these logic gates in order (XNOR,NOR,NOT,NAND). Now logic gates and all that related shit are my arch nemesis but I have no fucking clue how this would even work. Is this somethign that's trivially simple and I'm just being dense or is this as puzzling as it seems?

Sorry if these kind of questions are taboo or whatever, I wasn't willing to lurk for a few months before asking.

Name: Anonymous 2011-08-21 20:25

>>12
Read my post until you understand it completely (especially the last part).

Let's say you want to write, as described in my post, an
adder function (...) [that takes] a 4+4+1=9 bit input (first_digit,second_digit,prev_carry), and produces a 4+1 bit output (out_digit,carry).
Any digit between 0 and 9 inclusively can be represented as a 4-bit number (assuming you know how binary works). Valid "digits" are therefore 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001. Now you add together the two input digits (which is each 4-bit wide), along with the carry from the previous adder. The result r is a 5-bit number between 0 and 19. Now, if the r < 10 then you can just output (result_digit=r,carry=0). However, if r ≥ 10, you must compute r-10 -- this is actually equivalent to computing r+22, ignoring overflow/carry (because 22 is http://en.wikipedia.org/wiki/Two%27s_complement of 10). Then you can output (result_digit=r+22,carry=1).

If you still don't get it, I'll make a diagram. But I really recommend using a program like LogiSim or MMLogic to play around with logic gates.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List