Normal decimal numbers are based on powers of 10. The individual digits are (from right to left):
ones (10^0),
tens (10^1),
hundreds (10^2),
etc.
So, 365 is really 5 ones, plus 6 tens, plus 3 hundreds. 5 + 60 + 300 = 365
Binary numbers are based on powers of two. The individual bits (Binary digITS) are:
ones (2^0),
twos (2^1),
fours (2^2),
eights (2^3),
etc.
So, your binary 00110 is really 0 ones, plus 1 twos, plus 1 fours. 0 + 2 + 4 = 6 your 00110 binary is equal to 6 decimal.
0 = 00000 1 = 00001 2 = 00010 3 = 00011 4 = 00100 5 = 00101 6 = 00110 7 = 00111 8 = 01000 9 = 01001 10 = 01010 11 = 01011 12 = 01100 13 = 01101 14 = 01110 15 = 01111 16 = 10000 17 = 10001 18 = 10010 19 = 10011 20 = 10100
01 = 00001 11 = 01011 21 = 10101 02 = 00010 12 = 01100 22 = 10110 03 = 00011 13 = 01101 23 = 10111 04 = 00100 14 = 01110 24 = 11000 05 = 00101 15 = 01111 25 = 11001 06 = 00110 16 = 10000 26 = 11010 07 = 00111 17 = 10001 27 = 11011 08 = 01000 18 = 10010 28 = 11110 09 = 01001 19 = 10011 29 = 11101 10 = 01010 20 = 10100 30 = 11111
10000 00110 30000 00011 --------- 40121 ---------
Binary Coded Decimal (BCD) is a set of coding systems for storing decimal digits in binary code. There are several such codes, I will give examples of 3: straight BCD, XS3 BCD, and 2 of 5 BCD. Straight BCD uses the actual binary value of the decimal digit value: 0 = 0000 1 = 0001 2 = 0010 3 = 0011 4 = 0100 5 = 0101 6 = 0110 7 = 0111 8 = 1000 9 = 1001 XS3 BCD adds 3 to the binary value of the decimal digit value to make the code: 0 = 0011 1 = 0100 2 = 0101 3 = 0110 4 = 0111 5 = 1000 6 = 1001 7 = 1010 8 = 1011 9 = 1100 2 of 5 BCD uses a 5 bit code where only 2 bits can be on in a decimal digit's code: 0 = 00011 1 = 11000 2 = 10100 3 = 10010 4 = 10001 5 = 01100 6 = 01010 7 = 01001 8 = 00110 9 = 00101
The number 678 in binary is the ten-digit number 1010100110. (10101 00110) The digits in a binary number are exponents of 2 rather than 10, so that for a ten-digit number in binary, the digit places represent 512, 256, 128, 64, 32, 16, 8, 4, 2, 1 instead of increasing values of 10. 1010100110 = 512 + (0x256) + 128 + (0x64) + 32 + (0x16) + (0x8) + 4 + 2 + (0x1) = 678 This was determined using the subtraction method: 678 - 512 = 166 (1) no 256 (0) 166 - 128 = 38 (1) no 64 (0) 38 - 32 = 6 (1) no 16 (0) no 8 (0) 6 - 4 = 2 (1) 4 - 2 = 0 (1) no 1 (0) = 1010100110
0 = 00000 1 = 00001 2 = 00010 3 = 00011 4 = 00100 5 = 00101 6 = 00110 7 = 00111 8 = 01000 9 = 01001 10 = 01010 11 = 01011 12 = 01100 13 = 01101 14 = 01110 15 = 01111 16 = 10000 17 = 10001 18 = 10010 19 = 10011 20 = 10100
Try this, i searched for it on the global codes for country and it worked. 00110-9000
Oh, what a lovely question! Let's paint a happy little binary chart together. In binary, we count in powers of 2, so the numbers 1 to 20 in binary are: 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100. Each number is like a little brushstroke on the canvas of mathematics.
Each bit allows 21 combinations. Accordingly, n number of bits provide 2n combinations.Therefore, 5 bits provide 25 = 32 combinations. # 00001 # 00010 # 00011 # 00100 # 00101 # 00110 # 00111 # ...
3
01 = 00001 11 = 01011 21 = 10101 02 = 00010 12 = 01100 22 = 10110 03 = 00011 13 = 01101 23 = 10111 04 = 00100 14 = 01110 24 = 11000 05 = 00101 15 = 01111 25 = 11001 06 = 00110 16 = 10000 26 = 11010 07 = 00111 17 = 10001 27 = 11011 08 = 01000 18 = 10010 28 = 11110 09 = 01001 19 = 10011 29 = 11101 10 = 01010 20 = 10100 30 = 11111
3n base operations. These are you three states. Represented by 0, 1, 2. so taking a 2 trinary digit input: or 32 =9 possibilities. 00 01 02 10 11 12 20 21 22 for 33 =27 possibilities with a 3 trinary digit input. 000 001 002 010 011 012 020 021 022 100 101 102 110 111 112 120 121 122 200 201 202 210 211 212 220 221 222 Now for the trinary word: 34 assuming that we want a span of 4 digits to hold trinary values. 81 possibilities for a word value. 0000 0001 0002 1000 1001 1002 2000 2001 2002 0010 0011 0012 1010 1011 1012 2010 2011 2012 0020 0021 0022 1020 1021 1022 2020 2021 2022 0100 0101 0102 1100 1101 0102 2100 2101 2102 0110 0111 0112 1110 1111 1112 2110 2111 2112 0120 0121 0122 1120 1121 1122 2120 2121 2122 0200 0201 0202 1200 1201 1202 2200 2201 2202 0210 0211 0212 1210 1211 1212 2210 2211 2212 0220 0221 0222 1220 1221 1222 2220 2221 2222 Each square of trits- trinary digits are 3x3 squares for easy reading. The 3n seems to have 9 as a factor in the higher orders from n=3 to n= 4. I'll see what n=5 comes out as. As in how many digit combinations to form 5 input trinary. 00000 00001 00002 01000 01001 01002 02000 02001 02002 00010 00011 00012 01010 01011 01012 02010 02011 02012 00020 00021 00022 01020 01021 01022 02020 02021 02022 00100 00101 00102 01100 01101 01102 02100 02101 02102 00110 00111 00112 01110 01111 01112 02110 02111 02112 00120 00121 00122 01120 01121 01122 02120 02121 02122 00200 00201 00202 01200 01201 01202 02200 02201 02202 00210 00211 00212 01210 01211 01212 02210 02211 02212 00220 00221 00222 01220 01221 01222 02220 02221 02222 10000 10001 10002 11000 11001 11002 12000 12001 12002 10010 10011 10012 11010 11011 11012 12010 12011 12012 10020 10021 10022 11020 11021 11022 12020 12021 12022 10100 10101 10102 11100 11101 11102 12100 12101 12102 10110 10111 10112 11110 11111 11112 12110 12111 12112 10120 10121 10122 11120 11121 11122 12120 12121 12122 10200 10201 10202 11200 11201 11202 12200 12201 12202 10210 10211 10212 11210 11211 11212 12210 12211 12212 10220 10221 10222 11220 11221 11222 12220 12221 12222 20000 20001 20002 21000 21001 21002 22000 22001 22002 20010 20011 20012 21010 21011 21012 22010 22011 22012 20020 20021 20022 21020 21021 21022 22020 22021 22022 20100 20101 20102 21100 21101 21102 22100 22101 22102 20110 20111 20112 21110 21111 21112 22110 22111 22112 20120 20121 20122 21120 21121 21122 22120 22121 22122 20200 20201 20202 21200 21201 21202 22200 22201 22202 20210 20211 20212 21210 21211 21212 22210 22211 22212 20220 20221 20222 21220 21221 21222 22220 22221 22222 243 possibilities. Still has 9 as a factor 27 times. Don't know what pragmatic use this has. But it does make an easy square grid pattern. The binary in use from 22=4 and 25=32 possibilities. n=2 00 01 10 11 n=3 000 001 010 011 100 101 110 111 n=4 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 n=5 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 01010 01011 01100 01101 01110 01111 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111