How to add two 4-bit numbers
How do i add two four bit numbers, what are the steps required to do so?
|
What kind of equipment is available? Are you looking for a chart of NAND gates or a line of a C program or what?
|
No ,nothing like that, just how do i add two four bit numbers manually on paper. Like 0000 + 0001.
|
0000
0001 ---- 0001 It's the same like adding decimal numbers. The same rules apply. |
Quote:
|
In decimal when you get to 10 you write a single digit in the current column and carry 1 to the next column (left, more significant). Binary is just the same except it's 2 that brings you to the carry - there are only two single digits 0 and 1.
|
Quote:
http://www.math.grin.edu/~rebelsky/C...student-binary Daniel B. Martin |
Quote:
Here's a few other examples: Code:
0010 |
It's exactly like base 10: 0 + 1 = 1 ... etc[/b] ... 1 + 1 = 1 carry 1.
It does take a bit of getting used two ... ;) |
|
It's the same as adding in any other base. Base 2, base 8, base 10, base 16, it all works the same.
Start at the LSB, add the numbers together. If you overflow that digit (2 in base 2, 8 in base 8, 10 in base 10, etc), then carry the 1 into the next most significant column and repeat. |
Quote:
|
Like the much repeated phrase "There are 10 types of people in the world: those that understand binary and those that don't.".
|
Thank you, i've understood what to do :) Sorry laho guess i thought binary addition would be 'harder' than that.
|
Quote:
jlinkels |
Quote:
|
Good idea will check it out.
|
Quote:
Modern world appears to be completely dumbed down - we were taught the above at school, before age of 17. |
Quote:
Computers don't care - they are not humans. |
Quote:
He insisted on a standard file name convention, wich was FILENAME.YMD. 8.3 filenames only, remember? So to write YMD, we used that last digit of the year, the month in base-12, and the day in base-31. Base-31 is not difficult, just continue to use alphanumerics after F... After some practicing most of us could remember the ordinals of the characters by heart. I have been using this base-31 file extensions for many years after that, until the 8.3 filenames completely disappeared. jlinkels |
Quote:
It gets me all worked up...sorry about the tangent. |
I think you are right about the laziness/shortsightedness of certain programmers, but with 8.3 filenames there was little other choice. Maybe 8.3 was not such a good idea.
jlinkels |
Quote:
My inner pedant emerges again. Someone should have noticed that after the old "10 people...." thing came up. While tempting to bash Microsoft for the whole 8.3 filename thing, I'm fairly sure it was a deliberate choice to be compatible with CP/M. --- rod. |
All times are GMT -5. The time now is 10:21 PM. |