Click on the "List Generator" link below to access a web page that will generate the list of numbers to convert. To get the list for you, enter the digits of your z-id. Don't enter the 'z'. This will display a page with 5 values listed in a column.
The numbers are in decimal base and are to be stored in a 2 byte (16 bit) signed storage. Perform the following actions :
Use divide by 2 (divisor) method to convert to binary.
77 | ||
Dividend | Quotient | Remainder |
77 | 38 | 1 |
38 | 19 | 0 |
19 | 9 | 1 |
9 | 4 | 1 |
4 | 2 | 0 |
2 | 1 | 0 |
1 | 0 | 1 |
1001101 | ||
Subtracting powers of 2
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0 128 64 32 16 8 4 2 1 2^15 2^14 2^13 2^12 2^11 2^10 2^9 2^8 32768 16384 8192 4096 2048 1024 512 256 |
77 77 - ( 64 * 1 ) = 13 13 - ( 32 * 0 ) = 13 13 - ( 16 * 0 ) = 13 13 - ( 8 * 1 ) = 5 5 - ( 4 * 1 ) = 1 1 - ( 2 * 0 ) = 1 1 - ( 1 * 1 ) = 0 1001101 |
Bit | calculation | Sum |
1 | 1+0 | 1 |
0 | 0+1*2 | 2 |
0 | 0+2*2 | 4 |
1 | 1+4*2 | 9 |
1 | 1+9*2 | 19 |
0 | 0+19*2 | 38 |
1 | 1+38*2 | 77 |
Summing powers
1 * 64 64 0 * 32 0 0 * 16 0 1 * 8 8 72 1 * 4 4 0 * 2 0 1 * 1 1 5 77 |
Hex 0 1 2 3 4 5 6 7 0000 0001 0010 0011 0100 0101 0110 0111 8 9 A B C D E F 1000 1001 1010 1011 1100 1101 1110 1111 Hex 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 4 D Hexadecimal Octal 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 1 1 5 Octal Two's complement :For each number, :0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 : value left padded to 16 bit. 1 1 1 1 1 1 1 1 1 0 1 1 0 0 1 0 : 1's complement. + 1 : add 1 1 1 1 1 1 1 1 1 1 0 1 1 0 0 1 1 : 2's complement. Convert back to unsigned using shift(multiply) and add. 1 1 1 1 2+1 3 1 6+1 7 1 14+1 15 1 30+1 31 1 62+1 63 1 126+1 127 1 254+1 255 1 510+1 511 0 1022+0 1022 1 2044+1 2045 1 4090+1 4091 0 8182+0 8182 0 16364+0 16364 1 32728+1 32729 1 65458+1 65459