December 20, 2014 afternoon
A Binary conversion
Computer base system: Binary, Decimal, octal, Hex.
(a) binary → decimal
1. Add the right to the exhibition
Step: The first step: Write "2".
The second step is to mark the index, starting from right to left 0.
The third step: multiply coefficient, each correspondence.
Fourth step: Add.
Example: Two-class system number: 11010 turn decimal.
11010
The first step
2 2 2) 2 2
Step Two
24 23 22) 21 20
Step Three
24*1 23*1 22*0 21*1 20*0
Fourth Step
24*1+23*1+22*0+21*1+20*0=26.
2, Mental Arithmetic law:8421
Example: Binary number 11010
1 1 0) 1 0
↓↓↓↓↓
8 4 2 1 is 16+8+2=26.
(b) decimal → Binary
(except for the second redundancy)
The first step: use Vertical to decimal number in order to divide 2, record each step remainder.
The second step: always in addition to the quotient 0, the remainder is recorded from the bottom up, that is, the binary number.
(c) octal → Decimal
(d) decimal → octal (045)
(v) hex → Decimal
(vi) decimal → Hex (0x12,0x234) (0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f)
(vii) binary → octal ( right-to-left three-digit group )
(eight) octal → Binary ( split three )
(ix) binary → hexadecimal (right- to-left four-digit group )
(10) hex → Binary ( split four )
2014.12.20 Study Summary