HW #2. Data Representation - Part 2 - Complement, Addition, and Subtraction 1. Using five bits to represent each number, write the representations of 9 and -9 in 1's complement, signed magnitude, and 2's complement integers. 2. Write the six-bit 2's complement representation of -27. 3. Convert the following decimal numbers to 12 bit 2's complement: a. -145 b. 1025 c. -1536 d. 1729 e. -999 4. Convert the following 2's complement binary numbers to decimal. a. 1010 b. 0101 c. 10010110 d. 0111010010110011 5. Convert the following decimal numbers to binary 4-bit 2's complement representations or explain why the conversion is not possible. a. 5 b. -7 c. 8 d. -12 e. -1 f. 7f. 14 6. Answer the following questions: a. What is the largest positive number one can represent in a 12-bit 2's complement code? Write your result in binary and decimal. b. What is the greatest magnitude negative number one can represent in a 12-bit 2's complement code? Write your result in binary and decimal. c. What is the largest positive number one can represent in n-bit 2's complement code? d. What is the greatest-magnitude negative number one can represent in n-bit 2's complement code? 7. Using 7 bits to represent each number, write the representations of 29 and -29 in signed magnitude, 1's complement, and 2's complement integers. Provide results in a table 8. Show the 8-bit binary signed-magnitude representation for the following decimal numbers: a. 10910 b. -10910 C. +4310 d. -4310 e. +(0)10 f. -(0)10 9. Perform the following additions and subtractions. Assume the numbers are stored in signed-magnitude base 2 representation. a. 011010010 b. 100101110110 c. -101001+ −01111 d. -11001001011 10. Perform the following additions. Assume that all numbers are in 8-bit 2's complement notation. State the carry-in and carry-out, whether it overflows or not, and if the result is correct. a. 01111100 + 00110110 b. 10010010 + 11100111 c. 00110101 + 11001011 d. 11110001 + 00010111 11. Perform the following subtractions. Assume that all numbers are in 2's complement notation. State the carry-in and carry-out, whether it overflows or not, and if the result is correct. a. 101101 01101 - b. 010110101001 c. 01100100 - 11101010 d. 10001111 - 00110010 12. Perform the following additions and subtractions in hexadecimal. Assume the numbers are stored in hexadecimal representation (base-16 arithmetic). a. 7A5+1F3C b. CODE BEEF c. 3B2D 09A7 d. 120400FE 12. Perform the following hexadecimal additions and subtractions. Assume the numbers are stored as 32-bit 2's complement binary numbers. Indicate the sign of the answer and whether overflow occurs. a. 7FFF8000 + 00018000 b. 80000000 + 80000000 c. FFFFFFFF - 00000002 d. 40000000 C0000000

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 4PE
icon
Related questions
Question
HW #2. Data Representation - Part 2 - Complement, Addition, and Subtraction
1. Using five bits to represent each number, write the representations of 9 and -9 in 1's
complement, signed magnitude, and 2's complement integers.
2. Write the six-bit 2's complement representation of -27.
3. Convert the following decimal numbers to 12 bit 2's complement:
a. -145 b. 1025 c. -1536 d. 1729 e. -999
4. Convert the following 2's complement binary numbers to decimal.
a. 1010 b. 0101 c. 10010110
d. 0111010010110011
5. Convert the following decimal numbers to binary 4-bit 2's complement representations
or explain why the conversion is not possible.
a.
5 b. -7
c. 8
d. -12 e. -1 f. 7f. 14
6. Answer the following questions:
a. What is the largest positive number one can represent in a 12-bit 2's complement code?
Write your result in binary and decimal.
b. What is the greatest magnitude negative number one can represent in a 12-bit 2's
complement code? Write your result in binary and decimal.
c. What is the largest positive number one can represent in n-bit 2's complement code?
d. What is the greatest-magnitude negative number one can represent in n-bit 2's complement
code?
7. Using 7 bits to represent each number, write the representations of 29 and -29 in
signed magnitude, 1's complement, and 2's complement integers.
Provide results in a table
8. Show the 8-bit binary signed-magnitude representation for the following decimal
numbers:
a. 10910
b. -10910 C. +4310
d. -4310
e. +(0)10
f. -(0)10
9. Perform the following additions and subtractions. Assume the numbers are stored in
signed-magnitude base 2 representation.
a. 011010010
b. 100101110110
c. -101001+ −01111
d. -11001001011
Transcribed Image Text:HW #2. Data Representation - Part 2 - Complement, Addition, and Subtraction 1. Using five bits to represent each number, write the representations of 9 and -9 in 1's complement, signed magnitude, and 2's complement integers. 2. Write the six-bit 2's complement representation of -27. 3. Convert the following decimal numbers to 12 bit 2's complement: a. -145 b. 1025 c. -1536 d. 1729 e. -999 4. Convert the following 2's complement binary numbers to decimal. a. 1010 b. 0101 c. 10010110 d. 0111010010110011 5. Convert the following decimal numbers to binary 4-bit 2's complement representations or explain why the conversion is not possible. a. 5 b. -7 c. 8 d. -12 e. -1 f. 7f. 14 6. Answer the following questions: a. What is the largest positive number one can represent in a 12-bit 2's complement code? Write your result in binary and decimal. b. What is the greatest magnitude negative number one can represent in a 12-bit 2's complement code? Write your result in binary and decimal. c. What is the largest positive number one can represent in n-bit 2's complement code? d. What is the greatest-magnitude negative number one can represent in n-bit 2's complement code? 7. Using 7 bits to represent each number, write the representations of 29 and -29 in signed magnitude, 1's complement, and 2's complement integers. Provide results in a table 8. Show the 8-bit binary signed-magnitude representation for the following decimal numbers: a. 10910 b. -10910 C. +4310 d. -4310 e. +(0)10 f. -(0)10 9. Perform the following additions and subtractions. Assume the numbers are stored in signed-magnitude base 2 representation. a. 011010010 b. 100101110110 c. -101001+ −01111 d. -11001001011
10. Perform the following additions. Assume that all numbers are in 8-bit 2's complement
notation. State the carry-in and carry-out, whether it overflows or not, and if the result
is correct.
a. 01111100 + 00110110
b. 10010010 + 11100111
c. 00110101 + 11001011
d. 11110001 + 00010111
11. Perform the following subtractions. Assume that all numbers are in 2's complement
notation. State the carry-in and carry-out, whether it overflows or not, and if the result
is correct.
a. 101101 01101
-
b. 010110101001
c. 01100100 - 11101010
d. 10001111 - 00110010
12. Perform the following additions and subtractions in hexadecimal. Assume the numbers
are stored in hexadecimal representation (base-16 arithmetic).
a. 7A5+1F3C
b. CODE BEEF
c. 3B2D 09A7
d. 120400FE
12. Perform the following hexadecimal additions and subtractions. Assume the numbers are
stored as 32-bit 2's complement binary numbers. Indicate the sign of the answer and
whether overflow occurs.
a. 7FFF8000 + 00018000
b. 80000000 + 80000000
c. FFFFFFFF - 00000002
d. 40000000 C0000000
Transcribed Image Text:10. Perform the following additions. Assume that all numbers are in 8-bit 2's complement notation. State the carry-in and carry-out, whether it overflows or not, and if the result is correct. a. 01111100 + 00110110 b. 10010010 + 11100111 c. 00110101 + 11001011 d. 11110001 + 00010111 11. Perform the following subtractions. Assume that all numbers are in 2's complement notation. State the carry-in and carry-out, whether it overflows or not, and if the result is correct. a. 101101 01101 - b. 010110101001 c. 01100100 - 11101010 d. 10001111 - 00110010 12. Perform the following additions and subtractions in hexadecimal. Assume the numbers are stored in hexadecimal representation (base-16 arithmetic). a. 7A5+1F3C b. CODE BEEF c. 3B2D 09A7 d. 120400FE 12. Perform the following hexadecimal additions and subtractions. Assume the numbers are stored as 32-bit 2's complement binary numbers. Indicate the sign of the answer and whether overflow occurs. a. 7FFF8000 + 00018000 b. 80000000 + 80000000 c. FFFFFFFF - 00000002 d. 40000000 C0000000
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
A+ Guide to Hardware (Standalone Book) (MindTap C…
A+ Guide to Hardware (Standalone Book) (MindTap C…
Computer Science
ISBN:
9781305266452
Author:
Jean Andrews
Publisher:
Cengage Learning
A+ Guide To It Technical Support
A+ Guide To It Technical Support
Computer Science
ISBN:
9780357108291
Author:
ANDREWS, Jean.
Publisher:
Cengage,
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT