Design of a simple adder/subtactorThe steps in designing a simple one-bit Adder/Subtractor
Tip: Look at breaking the problem down into smaller pieces that we can cascade or hierarchically layer. This makes working out the simplest boolean form much easier. Lets start with the LSB - least significant bit.
Stage 1 - Truth table
The one bit adder does just that - adds two single bit values together. The 'c' column is a 'carry' column. When we add 01 and 01 we get 10 - that single bit value is zero - but we have to carry a value on to the next column. The S0 output can be seen to be XOR (only high if a or b is high - not if both are high or both are low. s0 = a0 XOR b0 c1 = a0 AND b0 C1 output can be seen to be high only when a and b are high so it is an AND relationship. We can now look at the second, and subsequent, columns - but this time there is a 'c' column to take into account too... as we might have to 'carry' a value.
This time we have the possibility of a carry-bit from the addition of the LSB column.
s1 = XOR (aibici) - XOR is high if number of inputs is odd. c2 = a1b1+ b1c1 + a1c1 This can be applied to any line of the truth table... so if we replace the number of the bit-line we are examining with 'i' we get:
We can now draw a logic gate diagram for the adder. The truth table and the logic gate diagram uses 'i' and 'i+1' etc to be 'general'. You could therefore do any level you were asked to. For example if 'i' was 3 the values would be: s3 = XOR(a3,b3,c3) c4 = a3b3 +a3c3 +b3c3
|
Follow me...
|