Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
When you count from 0 to 9, you are counting in "base 10" (decimal), where there are ten numbers, 0-1-2-3-4-5-6-7-8-9. In binary or "base 2", there are only two numbers, 0 and 1.
Counting:
Decimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
10 1010
11 1011
12 1100
13 1101
14 1110
15 1111Usually binary is done in groups of four, each group is called a "word". To translate a number into binary:
8 4 2 1
The above would be place markers. The highest number that can fit in the first binary word is 15. Notice that the smallest decimal number is on the far right, above. To convert a number, first subtract the largest of the binary places that you can.
If you wanted to convert 9 into binary, then 8 is the largest number you can subtract from it, so you have
8 4 2 1
1You cannot subtract 4 or 2 after subtracting 8 from 9, as only 1 is left, so put zeroes there.
8 4 2 1
1 0 0You can subtract 1, and then you are done, so decimal 9 is 1001 binary
8 4 2 1
1 0 0 1MSI K7N2 Delta-ILSR
AMD Athlon 2700+
1024MB Dual Channel DDR400 PQI Turbo
128MB Radeon 9200SE

To answer the "why" of binary, modern computers know only on and off, high and low voltage. These two states are represented mathematically as 1 and 0.
I disagree with Gordon about the definition of "word". I always thought 4 bits formed a "nibble" and four nibbles or 16 bits formed a "word".
The key to understanding any base is knowing what it means to write numbers the way we do. In base 10, 123 = 3*10^0 + 2*10^1 + 1*10^2 = 3 + 20 + 100. Binary works the same way. 1001 = 1*2^0 + 0*2^1 + 0*2^2 + 1*2^3 = 1 + 0 + 0 + 8 = 9.
I always think of the conversion base "x" algorithm as "Divide the number by x and the remainder will be the last digit of the base x representation. Divide the whole part of the answer from the previous division by x and the remainder is the second-to-last digit, and so on...". Gordon's method is faster for binary.

The size of a word differs depending on the processor.
Considering that most home-processors nowadays are 32-bit/4-byte (although there will be a trend to go to 64 bit in the coming years - I'm using a 64-bit Athlon as I type), a word is usually considered to be 32 bits.
And, as Jake mentioned, half a byte (4-bit) is a nybble - the term is rarely used, except when using hexadecimal (base 16) numbers.AKhalifman@hotmail.com

BlueRaja is right...The size of a word is defined by the architecture of the system. Technically, so is the size of a byte, but since it's been 8 bits on essentially every modern application it's pretty much a de facto definition.
I think the size of a word usually corresponds to how wide the memory bus is, but it doesn't have to.
-SN

Thanks for clearing up the word thing. I thought it was an archtecture thing, but I googled it and saw all these places that said 16 bits.
Back on topic, negative numbers are represented in binary with the "two's complement" form so that subtraction is actually addition. Two's compliment numbers work by making the addition carry past the number of bits the computer stores for the number. For example, in 8-bit binary 1 - 1 = 0 would be 1 + 1111 1111 = 1 0000 0000, but the leading one gets dropped so the answer becomes 0.

I always loved the term "nibble". Ever since I first played that QBasic game Nibbles I always hoped that I'd get to come up with a term like that someday. I can just see how it was thought up:
Engineer 1: Eight bits is a byte, but we use four bits to represent binary in hex. What can we call each of those?
Engineer 2: Well, they are half of a byte.
Engineer 1: So they are small bytes.
Engineer 2: And small bytes are nibbles... Hey!
Brilliant! :)

A Word is 16 bits, 32 bits is called a DoubleWord, at least in assembler language. 64 bits is called a QuadWord.
The only time a confusion might arise would be when the machine does not use 8,16,32 or 64 bits as basic storage unit. Some old or intermal cpu's use 10, 12 or 15 bits for rom store. HP41C uses 56 bits for cpu store, 10 bits for rom store and 8 bits for ram store.
With a 10 bit rom store one has 1024 possible instructions for the cpu (not counting multiword instructions).

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |