The binary number 10000000 represents the decimal 128
Chat with our AI personalities
Well, darling, the decimal equivalent to 1011 0000 is 176. Why? Because each digit in a binary number represents a power of 2, so you add up the values of the positions with a 1 in them. And voilà, you've got yourself a decimal number to work with!
The binary value 1000 0000 represents the decimal number 128. In binary, each digit's place value doubles from right to left, starting at 1. Therefore, the rightmost digit is 1, representing 2^0, and the leftmost digit is 1, representing 2^7, which equals 128 in decimal.
At least 8 bits are needed to represent the number 231. 231 ÷ 2 = 115 r 1 115 ÷ 2 = 57 r 1 57 ÷ 2 = 28 r 1 28 ÷ 2 = 14 r 0 14 ÷ 2 = 7 r 0 7 ÷ 2 = 3 r 1 3 ÷ 2 = 1 r 1 1 ÷ 2 = 0 r 1 → 231 is 1110 0111 in binary and has 8 binary digits. Thus 231 can be represented in 8 bits, but if more are provided, eg 16, it can still be represented (in 16 bits it would be 0000 0000 1110 0111, unless there is a binary point, with say 8 bits after it, then 231 would be 1110 0111 . 0000 0000).
Convert each binary number to decimal: Each digit to the left is worth twice what it is worth in the column to its right: each column starting from the right is worth 1, 2, 4, 8, 16, 32, ...; for an 8-bit number, the columns from the left are 128, 64, 32, 16, 8, 4, 2, 1; thus : 0000 1010 = 8 + 2 = 10 0110 0100 = 64 + 32 + 4 = 100 0001 0101 = 16 + 4 + 1 = 21 0000 0001 = 1 → 00001010.01100100.00010101.00000001 = 10.100.21.1 The IPv4 dotted decimal representation is just expressing the 32 bits of the address in the value of each of the 4 bytes used to store the 32 bits using decimal numbers with a dot between each byte's value so that it is not confused to be a single number, ie so that 10.100.21.1 is not read as 10100211 or 10,100,021,001 when the correct decimal value of the 32 bit binary number (0000 1010 0110 0100 0001 0101 0000 0001) is 174,331,137 (but converting that to binary is not as easy as converting an 8 bit (decimal number of range 0-255) to binary.
Ah, what a lovely question! The binary code for 2 is 10. Just like painting, binary code is a beautiful language that computers use to communicate. Keep exploring and learning, my friend!