



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




UCR · Math 135A
Decimal Binary Octal Hexidecimal (Base 10) (Base 2) (Base 8) (Base 16) 0 0000 00 00 1 0001 01 01 2 0010 02 02 3 0011 03 03 4 0100 04 04 5 0101 05 05 6 0110 06 06 7 0111 07 07 8 1000 10 08 9 1001 11 09 10 1010 12 0A 11 1011 13 0B 12 1100 14 0C 13 1101 15 0D 14 1110 16 0E 15 1111 17 0F
(anan− 1 · · · a 1 a 0 )β = an ∗ βn^ + an− 1 ∗ βn−^1 + ... + a 1 ∗ β^1 + a 0 ∗ β^0 = (x) 10
Fraction Part:
(0.b 1 b 2 b 3 · · · )β = b 1 ∗ β−^1 + b 2 ∗ β−^2 + b 3 ∗ β−^3 + ... = (x) 10
Example: Convert 21.112 in base 3 to base 10
(21.112) 3 = 2 ∗ 31 + 1 ∗ 30 + 1 ∗ 3 −^1 + 1 ∗ 3 −^2 + 2 ∗ 3 −^3 = 2 ∗ 3 + 1 ∗ 1 + 1 ∗ .333 + 1 ∗ .111 + 2 ∗. 037 = 6 + 1 + .333 + .111 +. 074 = (7. 518 ...) 10
(a) Divide the number by β and record the remainder. (b) Divide the resulting quotient by β and record the remainder. (c) Repeat (d) The number in base β is the remainders written in backwards order.
Fraction Part:
(a) Multiply the number by β and record the integer. (b) Multiply the resulting number (ignoring the integer) by β and record the integer. (c) Repeat (d) The number in base β is the integers written in forwards order.
Example: Convert 15.4375 in decimal (base 10) to binary (base 2)
4375 ∗ 2 = 0. 8750
875 ∗ 2 = 1. 750
75 ∗ 2 = 1. 50
5 ∗ 2 = 1. 0 Hence (0.4375) 10 = (0.0111) 2
132 ÷ 8 = 16 R 4
16 ÷ 8 = 2 R 0 2 ÷ 8 = 0 R 2 So (132) 10 = (204) 8 = (010 000 100) 2 = (10 000 100) 2
(d) Put it all together: First list the number from step (a), then step (c), then step (b):
(11000010010100001111000000000000) 2
(e) Convert to hexidecimal:
(1100 0010 0101 0000 1111 0000 0000 0000) 2
(C 250 F 000) 16
(a) Convert the machine representation in hexidecimal to binary. (b) Identify the sign, exponent, mantissa
± 1 .b 1 b 2 · · · bm × 2 n
where the sign is determined by step (c).
Example: Convert the single precision machine representation (BA390000) 16 to decimal.
(a) Convert the machine representation to binary:
(BA390000) 16 = (1011 1010 0011 1001 0000 0000 0000 0000) 2
(b) Identify the sign, exponent, mantissa: