in Binary each place is represented by a zero or a 1
so 0001 would be the decimal system 1
0010 would be the decimal system 2
The advantage of this is you can use this on electrical circuits, now especially in digital chips. So each circuit is either on which would be a binary 1 or a zero which is off (like a light switch) would be a place holder as non-activated circuit and depending upon which place it is in would represent different decimal numbers.
Then they figured out a alpha number code beyond this for digital representation of letters as well as numbers. So, when you see an "a" this is a decimal code too but is instead of a numeric code it is an alpha numeric code.
This is binary for 1 through 17 converted into decimal.
0hex | = | 0dec | = | 0oct | 0 | 0 | 0 | 0 | |
1hex | = | 1dec | = | 1oct | 0 | 0 | 0 | 1 | |
2hex | = | 2dec | = | 2oct | 0 | 0 | 1 | 0 | |
3hex | = | 3dec | = | 3oct | 0 | 0 | 1 | 1 | |
4hex | = | 4dec | = | 4oct | 0 | 1 | 0 | 0 | |
5hex | = | 5dec | = | 5oct | 0 | 1 | 0 | 1 | |
6hex | = | 6dec | = | 6oct | 0 | 1 | 1 | 0 | |
7hex | = | 7dec | = | 7oct | 0 | 1 | 1 | 1 | |
8hex | = | 8dec | = | 10oct | 1 | 0 | 0 | 0 | |
9hex | = | 9dec | = | 11oct | 1 | 0 | 0 | 1 | |
Ahex | = | 10dec | = | 12oct | 1 | 0 | 1 | 0 | |
Bhex | = | 11dec | = | 13oct | 1 | 0 | 1 | 1 | |
Chex | = | 12dec | = | 14oct | 1 | 1 | 0 | 0 | |
Dhex | = | 13dec | = | 15oct | 1 | 1 | 0 | 1 | |
Ehex | = | 14dec | = | 16oct | 1 | 1 | 1 | 0 | |
Fhex | = | 15dec | = | 17oct | 1 | 1 | 1 | 1 |
Binary may be converted to and from hexadecimal somewhat more easily. This is because the radix of the hexadecimal system (16) is a power of the radix of the binary system (2). More specifically, 16 = 24, so it takes four digits of binary to represent one digit of hexadecimal, as shown in the adjacent table.
To convert a hexadecimal number into its binary equivalent, simply substitute the corresponding binary digits:
- 3A16 = 0011 10102
- E716 = 1110 01112
- 10100102 = 0101 0010 grouped with padding = 5216
- 110111012 = 1101 1101 grouped = DD16
- C0E716 = (12 × 163) + (0 × 162) + (14 × 161) + (7 × 160) = (12 × 4096) + (0 × 256) + (14 × 16) + (7 × 1) = 49,38310
- end quote:
- So, if you go beyond 17 you have to add another place so instead of 1111 for the decimal 17 you would have to go to 00000 a fifth place to represent further. So, each time you run out of a zero and a 1 to represent something you have to add another place.
- You might think this is awkward but all digital computers at core start with idea at a machine language point which is below where programmers usually deal with but many programmers can "in an emergency" program in machine language too even though this can be extremely time consuming.
- However if things break down in certain ways you either do this or throw away the machinery one or the other.
- begin quote from:
- Binary number from wikipedia:
- Also, from a hexidecimal point of view you can see how the letters A through F are created in a binary way. Each number or letter can be a bit.
Decimal
patternBinary
number0 0 1 1 2 10 3 11 4 100 5 101 6 110 7 111 8 1000 9 1001 10 1010 11 1011 12 1100 13 1101 14 1110 15 1111
Decimal counting
Decimal counting uses the ten symbols 0 through 9. Counting begins with the incremental substitution of the least significant digit (rightmost digit) which is often called the first digit. When the available symbols for this position are exhausted, the least significant digit is reset to 0, and the next digit of higher significance (one position to the left) is incremented (overflow), and incremental substitution of the low-order digit resumes. This method of reset and overflow is repeated for each digit of significance. Counting progresses as follows:
- 000, 001, 002, ... 007, 008, 009, (rightmost digit is reset to zero, and the digit to its left is incremented)
- 010, 011, 012, ...
- ...
- 090, 091, 092, ... 097, 098, 099, (rightmost two digits are reset to zeroes, and next digit is incremented)
- 100, 101, 102, ...
Binary counting
- 0000,
- 0001, (rightmost digit starts over, and next digit is incremented)
- 0010, 0011, (rightmost two digits start over, and next digit is incremented)
- 0100, 0101, 0110, 0111, (rightmost three digits start over, and the next digit is incremented)
- 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111 ...
No comments:
Post a Comment