Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please assist and show how it was done if possible. Thank you. 7. Convert the fo

ID: 3663906 • Letter: P

Question

Please assist and show how it was done if possible. Thank you.

7. Convert the following decimal fractions to binary with a maximum of six places to the right of the binary point.

a. 26.78125

b. 194.03125

c. 298.796875

d.16.1240234375

13. Convert the hexadecimal number AC12_16 to binary.

14. Convert the hexadecimal number 7A01_16 to binary.

15. Convert the hexadecimal number DEAD BEEF_16 to binary.

16. Represent the following decimal numbers in binary using 8-bit signed magnitude, one’s complement, two’s complement, and excess-127 representations.

a. 77

b. -42

c. 119

d. -107

                      

Explanation / Answer

7. Convert the following decimal fractions to binary with a maximum of six places to the right of the binary point. a. 26.78125 b. 194.03125 c. 298.796875 d.16.1240234375 26.78125 Power of 2: 25 24 23 22 21 20 2-1 2-2 2-3 2-4 2-5 2-6 B Remainder of Division: 26.78125 26.78125 10.78125 2.78125 2.78125 0.78125 0.78125 0.28125 0.03125 0.03125 0.03125 0 C Place value (A result): 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625 D Binary digit B ÷ C: 0 1 1 0 1 0 1 1 0 0 1 0 26.78125-011010110010 A Power of 2: 28 27 26 25 24 23 22 21 20 2-1 2-2 2-3 2-4 2-5 B Remainder of Division: 194.03125 194.03125 66.03125 2.03125 2.03125 2.03125 2.03125 2.03125 0.03125 0.03125 0.03125 0.03125 0.03125 0.03125 C Place value (A result): 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 D Binary digit B ÷ C: 0 1 1 0 0 0 0 1 0 0 0 0 0 1 194.03125 -01100001000001 A Power of 2: 29 28 27 26 25 24 23 22 21 20 2-1 2-2 2-3 2-4 2-5 2-6 B Remainder of Division: 298.796875 298.796875 42.796875 42.796875 42.796875 10.796875 10.796875 2.796875 2.796875 0.796875 0.796875 0.296875 0.046875 0.046875 0.046875 0.015625 C Place value (A result): 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625 D Binary digit B ÷ C: 0 1 0 0 1 0 1 0 1 0 1 1 0 0 1 1 . 298.796875 -0100101010110011 A Power of 2: 25 24 23 22 21 20 2-1 2-2 2-3 2-4 2-5 2-6 B Remainder of Division: 16.124023 16.124023 0.124023 0.124023 0.124023 0.124023 0.124023 0.124023 0.124023 0.124023 0.061523 0.030273 C Place value (A result): 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625 D Binary digit B ÷ C: 0 1 0 0 0 0 0 0 0 1 1 1 010000000111 13. Convert the hexadecimal number AC12_16 to binary. AC12- 1010 1100 0001 0010 14. Convert the hexadecimal number 7A01_16 to binary. 7A01-0111 1010 0000 0001 15. Convert the hexadecimal number DEAD BEEF_16 to binary. 1101 1110 1010 1101 1011 1110 1110 1111 16. Represent the following decimal numbers in binary using 8-bit signed magnitude, one’s complement, two’s complement, and excess-127 representations. a. 77 b. -42 c. 119 d. -107 a) 77- 4. Binary code: 01001101 5. 01001101 (one's complement): 6. 01001101 (two's complement): b)-42 Binary code: 00101010 11010101 (one's complement): 11010110 (two's complement): c)119 Binary code: 01110111 01110111 (one's complement): 01110111 (two's complement): d)-107 01101011Binary code: 10010100 (one's complement): 10010101 (two's complement): So, here is some theory Binary code is the binary representation of unsigned integer. If we're talking about computers, there is certain number of bits used to represent the number. So, total range which can be represented by n-bits is Inverse code or one's complement is simply inverted binary code of a number. That is all zeroes become ones and all ones become zeroes. Complement code or `two's complement is inverse code plus one Now, what is all about? These codes were invented to make sign operations more comfortable (for machines). Since I'm a kind of person who likes to learn by example, I'll explain this statement on examples. Let's assume we have computer with 4-bits binary numbers. Total range which can be represented by 4-bits is 16 - 0,1,... 15 00 - 0000 ... 15 - 1111 But these are unsigned numbers and are not of much use. We need to introduce sign. So, half of range is taken for positive numbers (eight, including zero), and half of range - for negative (also eight). Note that machine considers zero as positive number, unlike usual math. So, our positives are 0,...,7, and negatives are -1,...,-8. To distinguish positive and negative numbers we assign left-most bit as sign bit. Zero in sign bit tells as that this is positive number and one - negative. Positive numbers are represented by plain binary code 0 - 0000 1 - 0001 ... 7 - 0111 But how negative numbers can be represented? Here comes the complement code. That is, -7 complement is binary 7 = 0111 inverse 7 = 1000 complement 7 = 1001 Note that binary 1001 is 9, which differs from -7 by 16, or . Or, which is the same, complement code "complements" binary code to , i.e. 7+9=16 This proved to be very useful for machine computation - usage of complement code to represent negatives allows engineers to use addition scheme for both addition and subtraction, thus simplifying the design of ALU (arithmetic and logical unit - part of processor). Also, this representation easily detects on overflow, and then there are not enough bits to represent the given number. Several examples 7-3=4 0111 binary 7 1101 two's complement of 3 0100 result of addition 4 -1+7=6 1111 two's complement of 1 0111 binary 7 0110 result of addition 6 Overflow is detected by looking at two last carries, including carry beyond right-most bit. If carry bits are 11 or 00, there is no overflow, if carry bits are 01 or 10, there is overflow. And, if there is no overflow, carry beyond right-most bit can be safely ignored. Some examples with carries and fifth bit (bit beyond right-most bit) 7+1=8 00111 binary 7 00001 binary 1 01110 carries 01000 result of addition 8 - overflow Two last carries are 01. This gives signal of overflow -7+7=0 00111 binary 7 01001 two's complement of 7 11110 carries 10000 result of addition 16 - but fifth bit can be ignored, real result is 0 Two last carries are 11. There is no overflow, so correct result is zero. Overflow check can be done by simple XOR-ing two last carry bits. Because of these convenient properties two's complement is most common method to represent negative numbers on computers. P.S. Inverse code, or one's complement, "complements" binary code to , (all ones). It also can be used to represent negatives, but addition scheme should employ cyclic carry and is more complex. Besides, range, which can be represented by n-bits is reduced by 1, since 1111 is busy as inverted 0000 - negative zero. So, it is less convenient.