In: Computer Science
1a. Convert 67 (base 10) to 8-bit binary using signed magnitude. Show your work.
1b. Convert 69 (base 10) to 8-bit binary using one’s complement. Show your work
1c. Convert 70 (base 10) to 8-bit binary using two’s complement. Show your work.
1d. Convert - 67 (base 10) to 8-bit binary using signed magnitude.
1e. Convert - 67 (base 10) to 8-bit binary using ones compliment. Show your work.
1f. Convert - 67 (base 10) to 8-bit binary using 2s compliment. Show your work.
Solution:
1(a)
Given,
=>Number = (67)10
Explanation:
Converting number into signed magnitude binary:
=>Positive numbers are represented in signed magnitude same as unsigned numbers.
=>67 % 2 => quotient = 33, remainder = 1
=>33 % 2 => quotient = 16, remainder = 1
=>16 % 2 => quotient = 8, remainder = 0
=>8 % 2 => quotient = 4, remainder = 0
=>4 % 2 => quotient = 2, remainder = 0
=>2 % 2 => quotient = 1, remainder = 0
=>1 % 2=> quotient = 0, remainder = 1
=>Arranging remainders from bottom to top = 1000011
=>Hence signed magnitude number representation of (67)10 = (1000011)2
=>Hence signed magnitude number representation of (67)10 in 8 bits = (01000011)2
1(b)
Given,
=>Number = (69)10
Explanation:
Converting decimal number into 1's complement form:
=>Positive numbers are represented in 1's complement form same as unsigned numbers.
=>69 % 2 => quotient = 34, remainder = 1
=>34 % 2 => quotient = 17, remainder = 0
=>17 % 2 => quotient = 8, remainder = 1
=>8 % 2 => quotient = 4, remainder = 0
=>4 % 2 => quotient = 2, remainder = 0
=>2 % 2 => quotient = 1, remainder = 0
=>1 % 2 => quotient = 0, remainder = 1
=>Arranging remainders from bottom to top = (1000101)2
=>Hence 1's complement number representation of (69)10 = (1000101)2
=>Hence 1's complement number representation of (69)10 in 8 bits = (01000101)2
1(c)
Given,
=>Number = (70)10
Explanation:
Converting decimal number into 2's complement form:
=>Positive numbers are represented in 2's complement form same as unsigned numbers.
=>70 % 2 => quotient = 35, remainder = 0
=>35 % 2 => quotient = 17, remainder = 1
=>17 % 2 => quotient = 8, remainder = 1
=>8 % 2 => quotient = 4, remainder = 0
=>4 % 2 => quotient = 2, remainder = 0
=>2 % 2 => quotient = 1, remainder = 0
=>1 % 2 => quotient = 0, remainder = 1
=>Arranging remainders from bottom to top = (1000110)2
=>Hence 2's complement number representation of (70)10 =(1000110)2
=>Hence 2's complement number representation of (70)10 in 8 bits = (01000110)2
1(d)
Given,
=>Number = (-67)10
Explanation:
Converting number into signed magnitude binary:
=>In case of negative decimal numbers representation is different
=>MSB of the signed magnitude number represents the sign of the number. If MSB = 1 then negative number otherwise positive number.
=>Remaining bits after MSB bits represents the modulus decimal value.
=>We know that (67)10 from part (a) = (1000011)2
=>Hence (-67)10 in signed magnitude representation = (11000011)2
1(e)
Given,
=>Number = (-67)10
Explanation:
Converting decimal number into 1's complement form:
=>In 1's complement form we flip each bit of the binary number of modulus value of decimal number.
=>We know that (67)10 from part (a) = (01000011)2
=>Hence (-67)10 in 1's complement form = (10111100)2
1(f)
Given,
=>Number = (-67)10
Explanation:
Converting decimal number into 2's complement form:
=>In case of negative numbers representation is different.
=>MSB of 2's complement number represents the sign of number, if MSB = 1 then number is negative otherwise positive.
=>All the bits represents the value of the 2's complement number.
=>We know that (67)10 from part (a) = (01000011)2
=>Hence (-67)10 in 1's complement form = (10111100)2
=>Hence (-67)10 in 2's complement form = (10111100)2 + (00000001)2
=>Hence (-67)10 in 2's complement form = (10111101)2
I have explained each and every part with the help of statements attached to it.