100% Guaranteed Results


ECE331 – Solved
$ 29.99
Category:

Description

5/5 – (1 vote)

Lab 1
Introduction and Number Representation
Qadis Chaudhry
1 Unsigned Integers
Conversions
(1111010101001110)2
a. Convert the following from their initial radix to the other two common radices:
0b011000101:
(198)10
27 + 26 + 22 + 20 =
(C5)16
(1100)2(0101)2 = (C)16(5)16 = 0xF54E:
(62798)10
15 ⇥ 163 + 5 ⇥ 162 + 4 ⇥ 16 + 14 =
(F)16(5)16(4)16(E)16 = (1111)2(0101)2(0100)2(1110)2 =

312:
312 ÷ 2 = 156 R0 156 ÷ 2 = 78 R0 78 ÷ 2 = 39 R1 39 ÷ 2 = 19 R1 19 ÷ 2 = 9 R1 9 ÷ 2 = 4 R1 4 ÷ 2 = 2 R0 2 ÷ 2 = 1 R0 1 ÷ 2 = 0 R1
(100111100)2
312 ÷ 16 = 19 R8
19 ÷ 16 = 1 R3
1 ÷ 16 = 0 R1
(138)16

0b10110111:
(183)10
27 + 25 + 24 + 22 + 21 + 20 =
(B7)16
(1011)2(0111)2 = 0x6BCC:
(27596)10
6 ⇥ 163 + 11 ⇥ 162 + 12 ⇥ 16 + 12 =
(110101111001100)2
(6)16(B)16(C)16(C)16 = (0110)2(1011)2(1100)2(1100)2 = 87:
87 ÷ 2 = 43 R1
43 ÷ 2 = 21 R1
21 ÷ 2 = 10 R1
87 ÷ 16 = 5 R7
10 ÷ 2 = 5 R0
5 ÷ 16 = 0 R5
5 ÷ 2 = 2 R1
(57)16
2 ÷ 2 = 1 R0
1 ÷ 2 = 0 R1
(1010111)2
b. Write the following using IEC prefixes:
229 : 512 Mi , 254 : 16 Pi , 216 : 64 Ki , 265 : 32 Ei , 233 : 8 Gi , 242 : 4 Ti
c. Write the following using SI prefixes:
105 : 100 K ,1016 : 10 P ,1010 : 10 G ,1019 : 10 E ,1027 : 1000 Y ,104 : 10 K
d. Write the following with powers of 10:
21 1021 ,9 Y : 9 1024
21 Z : ⇥ ⇥ ,13 K : 13 ⇥ 103
e. Write the following with powers of 2:
14 220 ,12 Ei : 12 260 ,27 Ki : 27 1010
14 Mi : ⇥ ⇥ ⇥
2 Signed Integers
Two’s Complement Exercises
1. What is the largest integer that can be represented with 16 bits? How many bits doyou need to represent the largest integer plus 1?
With Two’s Complement, the range is from 216 1 to 216 1 1, which is from -32,768 to 32,767. This makes the largest number able to be represented by Two’s Complement, 32,767. To represent the largest integer plus 1, you would need one more bit as this adds to the overall range making the new range from, -65536 to 65535.
With unsigned numbers, the largest number that can be represented is 216 1 = 65535. To represent the largest number plus one, once again, you would need 17 bits.
2. How do you represent the numbers 100, 6, and -5 (assume the numbers are 8 bits)?
100:
For positive integers, unsigned and Two’s Complement are exactly the same, so for 100, using the division technique,
100 ÷ 2 = 50 R0 50 ÷ 2 = 25 R0 25 ÷ 2 = 12 R1 12 ÷ 2 = 6 R0 6 ÷ 2 = 3 R0 3 ÷ 2 = 1 R1 1 ÷ 2 = 0 R1
The number (100)10 in 8 bit unsigned and Two’s Complement notation would be 01100100.
6:
Using the same technique as before and the same principle,
6 ÷ 2 = 3 R0 3 ÷ 2 = 1 R1 1 ÷ 2 = 0 R1
the 8 bit representation for the decimal number 6 in Two’s Complement as well as unsigned integers, would be 00000110.
-5:
Since this number is negative, it is signed and therefore cannot be represented using the unsigned integers. In this case, the number must be converted to binary and then using Two’s Complement, made negative.
5 ÷ 2 = 2 R1 2 ÷ 2 = 1 R0 1 ÷ 2 = 0 R1
Taking this number in 8 bits, (00000101)2 and converting it to negative using Two’s Complement, first we flip all the bits yielding, (11111010)2 and then we add 1 to the least significant bit, 11111011.
3. How do you represent 264 and -264 (assume the numbers are 8 bits)?
Finding the range for the maximum possible integer for 8 bit numbers, for unsigned we find that it is from 0 to 28 1 = 255, and for Two’s Complement it ranges from 28 1 to 28 1 1 which is from -128 to 127. In both of these cases, it can be seen that the value of 264 resides outside of the range for 8 bit numbers and therefore cannot be represented using either notation.
4. What is the range of decimal (presented with powers of 2) that 32-bit Two’s Complement can represent? Please explain why.
The range of numbers would be from 232 1 to 232 1 1, which would result in a range from -2147483648 to 2147483647. Represented using powers of 2 this would be, from -2 Gi to 2 Gi – 1. This happens to be the range since Two’s Complement has the ability to represent both positive and negative numbers and adding two opposite numbers together would have to result in zero. For this reason, since there are only a limited number of bits, in this case 32, the range will be half that of unsigned 32-bit integers. The maximum unsigned 32-bit integer can be represented as 232 which is 4294967296. This number is cut in half, and the negative integers can be represented up to -2147483648, and the maximum positive integer will be 2147483647 since we have to account for zero.
5. Why do computers use bytes for address representation?
Using bits would likely be too costly to be beneficial. Bytes are used for addressing as this allows for more addresses to be defined with a large number of bits.
6. How much data can we store on a 8 K-byte memory chip?
8 bytes will be equal to 8000 bytes, and since there are 8 bits in one byte, there are 64000 bits that can be stored on the chip. Since each of the registers in the chip can hold 32 bits, this leaves 2000 addresses in which information can be stored.
3 Counting
1. How many bits do we need to represent a variable that can only take on the values 10,20, 30, or 40?
Since the variable can only have four possible values, 22, 2 bits would be required to cover the four states.
2. If the only value a variable can take on is 98.65, how many bits are needed to representit?
Since there is only one value for this variable to take on the lowest possible number of bits would be 1 bit since it can hold two values and we cannot go lower than that.
3. If we need to address 4 Mi-Byte of memory and we want to address every byte ofmemory, how long does an address need to be?
4 Mi-Bytes would be equal to 4 ⇤ 220 Bytes, which equals 222 Bytes. Using the equation log2(n) which gives the number of bits needed to address some n number of bytes, we get that 22 bits are needed for each address.

Reviews

There are no reviews yet.

Be the first to review “ECE331 – Solved”

Your email address will not be published. Required fields are marked *

Related products