10101010 + 01111 = 10111001 (170+15 = 185)
Each place represents a power of 2. 10101010 base 2 = 27 + 25 + 23 + 21 = 128 + 32 + 8 + 2 = 170
vhdl code for binary to Hexadecimal ?
1110000 is 112 in binary.
1001110
10101010
In any base other than 2 (ie other than binary): 10101010 + 01111 = 10102121 In base 2 (binary): 10101010 + 01111 = 10111001
The binary number 10101010 is equivalent, in decimal representation, to 128 + 32 + 8 + 2 = 170. But this answer assumes that the given number is binary - an assumption for which there is no real justification. Besides, the relationship is an equivalence, which is not quite "the same thing".
10101010 + 01111 = 10111001 (170+15 = 185)
170
Decimal: 170Hex: AA
Each place represents a power of 2. 10101010 base 2 = 27 + 25 + 23 + 21 = 128 + 32 + 8 + 2 = 170
337
170/2 = 85 R 0. Therefore binary number so far is 0.85/2 = 42 R 1. Therefore binary number so far is 10.42/2 = 21 R 0. Therefore binary number so far is 010.21/2 = 10 R 1. Therefore binary number so far is 1010.10/2 = 5 R 0. Therefore binary number so far is 01010.5/2 = 2 R 1. Therefore binary number so far is 101010.2/2 = 1 R 0. Therefore binary number so far is 0101010.1/2 = 0 R 1. Therefore binary number so far is 10101010.The integer portion of last division was 0 so for the decimal number 170, the binary equivalent is 10101010.
10101010 in decimal = 9A2112 in Hex.
That IS the binary code.
Convert each group of 4 bits into one hexadecimal digit. 1010 is "A" in hexadecimal, so this particular number is "AA".