four bit adder

Thread Starter

subinznz

Joined Apr 23, 2012
1
Hi
how do i do this

the calculator takes in a double digit input,
each digit is encoded in 4 bit ( 0.....9)
the are both stored in order

e.g.
say i want to add 12 + 15

the encoding takes place for 12

first user inputs 1
so 0001 = 1
and then 2
so 0010 =2

then this value is stored.

what im wondering now is how do i make it that these two 4 bit binary numbers (0001,0010) give me

12 in binary (1100)

thanks plz guide me or am i going in the wrong direction

i am trying to make a calculator :)
 

WBahn

Joined Mar 31, 2012
29,978
How are you implementing the solution? In hardware? As a computer program?

Think about the underlying math of what you are trying to accomplish:

Using your example, you have a two digit number AB in which A=1 and B=2 with A and B stored separately. You now wish to combine those into a single value, C. So, what is C in terms of A and B? Hint: What makes BA (i.e., 21) different from AB (i.e., 12)?
 
Top