0% found this document useful (0 votes)
54 views

HW HTMT C.00 đã chuyển đổi

There are 3 sentences summarizing the key information from the document: 1) The document discusses binary number representations including unsigned integers, signed integers using 1's complement and 2's complement, and how to perform addition and conversion between binary and decimal numbers. 2) It provides examples of converting decimal numbers to their binary representations using 8-bit 2's complement, and converting binary numbers to decimal. 3) Key concepts covered include the maximum and minimum values for n-bit 2's complement numbers, how to determine if a 2's complement number is even or divisible by 4 based on its last digits, and how right shifting a binary number is equivalent to integer division by 2.

Uploaded by

Trần Tân
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

HW HTMT C.00 đã chuyển đổi

There are 3 sentences summarizing the key information from the document: 1) The document discusses binary number representations including unsigned integers, signed integers using 1's complement and 2's complement, and how to perform addition and conversion between binary and decimal numbers. 2) It provides examples of converting decimal numbers to their binary representations using 8-bit 2's complement, and converting binary numbers to decimal. 3) Key concepts covered include the maximum and minimum values for n-bit 2's complement numbers, how to determine if a 2's complement number is even or divisible by 4 based on its last digits, and how right shifting a binary number is equivalent to integer division by 2.

Uploaded by

Trần Tân
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Part 2.

1. How many possible states (combinations) from 5 bits, 6 bits, 7 bits.


There are 32, 64 and 128

2. If we use the numbers of bits above as numbers of address pins of memory. Give
these addresses.
There are 32, 64 and 128 lines

3. Give ranges of unsigned integers, signed integers (2’s comp.) from 6, 7 bits.

Unsigned integers: 0-63, 0-127


Signed integers (2’s comp.): -32 to 31; -64 to 63

4. Look for 2’s comp. of 15, 25.5, -14.25, -25.625


2’s comp of 15: 01111
2’s comp of 25.5: 011001.1
2’s comp of -14.25 : 10001.110
2’s comp of -25.625: 100110.011

5. Take sums in binary systems:


32.25 – 11.625 9.25 – 6.5
0100000.010 01001.01
+1110100.011 + 11001.10
------------------- ---------------
0010100.101 00010.11
6. Convert 1001011 to decimal (by default), and if it is an unsigned integer.
an unsigned integer: 75
decimal (by default): -53

7. Given A = 0100, B = 1001, C = 1011


Do actions below
- A or B and not C
- A or not B or not C and A
0100 0100 OR
1001 OR 0110
---------- ---------------
1101 1010
AND 0100 OR 0100
----------- -----------------
10001 1110
AND 0100
--------------------
10010

Part 3.
.5 Using 5 bits to represent each number, write the representations of 7 and —
7 in l's complement, signed magnitude, and 2's complement integers.
7: 00111
-7:11001
2.6 Write the 6-bit 2's complement representation of —32.
-32: 100000
2.7 Create a table showing the decimal values of all 4-bit 2's
complement numbers.
2.8 a. What is the largest positive number one can represent in an 8-bit
2's complement code? Write your result in binary and decimal.
Bin:11111111
Dec:255
b. What is the greatest magnitude negative number one can represent in
an 8-bit 2's complement code? Write your result in binary and decimal.
Bin:100000000
Dec:-256
c. What is the largest positive number one can represent in n-bit 2's
complement code? 2^(n-1) -1

d. What is the greatest magnitude negative number one can represent in


n-bit 2's complement code? – 2^(n-1)
2.9 How many bits are needed to represent Avogadro's number (6.02
• 1023) in 2's complement binary representation? 80
2.10 Convert the following 2's complement binary numbers to
decimal.
a. 1010 -> -6
b. 01011010 -> 90
c. 11111110 -> -130
d. 0011100111010011-> 14803
2.11 Convert these decimal numbers to 8-bit 2's complement binary numbers.
a. 102->01100110
b. 64->1000000
c. 33->100001
d. - 1 2 8->10000000

2.12 If the last digit of a 2's complement binary number is 0, then


the number is even. If the last two digits of a 2's complement binary
number are 00 (e.g., the binary number 01100), what does that tell you
about the number?
that the number is divisible by 4 in decimal format
2.13 Without changing their values, convert the following 2's
complement binary numbers into 8-bit 2's complement numbers.
a. 1010->11111010 c. 1111111000->11111000
h 011001->00011001 d. 01-> 00000001
2.14 Add the following bit patterns. Leave your results in binary form.
a. 1011 + 0001 = 1100
b. 0000 + 1010 = 1010
c. 1100 + 0011 = 1111
d. 0101 + 0110 = 1011
e. 1111 + 0001 = 10000
2.15 It was demonstrated in Example 2.5 that shifting a binary number one bit to
the left is equivalent to multiplying the number by 2. What operation is performed
when a binary number is shifted one bit to the right? You divide it by 2
representation of —7.
2.17 Add the following 2's complement binary numbers. Also express the
answer in decimal.
a. 01 + 1011 =1100
b. 11 + 01010101 = 01010100
c. 0 1 0 1 + 110= 0011
d. 01 + 10= 11
2.18 Add the following unsigned binary numbers. Also, express the answer in
decimal.
a. 01 + 1011=1100
b. 11 + 01010101=010101100
c. 0101 + 110=1011
d. 01 + 10=11

You might also like