Mictrocontroller Week 03 Numbering systems 1. Convert the decimal number 123.456 to the following formats, taking whole numbers and fractions into account. Show calculations. a) Binary Fractional part : Reading direction Integral part: Reading direction 0,456 x 2 = 0,912 0 123 / 2 = 61 1 0,912 x 2 = 1,812 1 61 / 2 = 30 1 0,812 x2 = 1,624 1 30 / 2 = 15 0 0,624 x 2 = 1,248 1 15 / 2 = 7 1 0,248 x 2 = 0,496 0 7/2=3 1 0,496 x 2 = 0,992 1 3/2=1 1 0 1 1 0 0 So 123.45610 = 0111 1011.0111 01002 b) Hexadecimal Fractional part :
Homework 1 in Microcontrollers and practical robotics 1) a) 0 123.456 - 64 = 59.456 1 59.456 - 32 = 27.456 1 27.456 - 16 = 11.456 1 11.456 - 8 = 3.456 1 3.456 - 4 = 0 3.456 - 2 = 1.456 1 1 0.456 * 2 = 0.912 0 0.912 * 2 = 1.824 1 0.824 * 2 = 1.642 1 0.642 * 2 = 1.284 1 0.284 * 2 = 0.568 0 0.568 * 2 = 1.136 1 0.136 * 2 = 0.272 0 0,544 * 2 = 0,544 0 b)1111011.01110100 to hex 0111 => 7 1011 => 11 0111 => 7 0100 => 4 and so on.. answer is: 7B.74 c) 123.456 to base-5 100 = 400 20 = 40 3=3 400 + 40 + 3 = 443 5^-1 = 0,2 5^-2 = 0,04 5^-3 = 0,008 0,456/0,2 = 2 0,056/0,04 = 1,4 0,4/0,2 = 2 Final answer 443.212 d) 1 = 0001 2 = 0010 3 = 0011 4 = 0100 5 = 0101 6 = 0110 0001 0010 0011.0100 0101 0110 2) a) 16bit equivalent is a) 0000000001101011 the answer is 006B 1011 is in dec 11 and in hex B 0110 is in dec 6 and in hex also 6 b) 16bit equivalent is b) 0000000
Kõik kommentaarid