You are on page 1of 15

ELEC 1510 Homework 1 Solutions, Fall 2013

Due: Monday, August 26, 2013, 5 p.m. (start of class)

Student Name:___________________________________

Instructions: You must show your work (where appropriate) to receive credit. A correct answer with no
work shown will receive zero points. Your writing must be neat as well to receive credit. You must
complete all problems to receive full credit. Complete your homework submission and attach it (stapled)
to this cover sheet. Recopy the problem statement onto your homework answers. Failure to follow
instructions will result in a loss of points.

Each page of your homework must have the following information on the top: ELEC 1510, Homework 1,
Your Name, Page Number

Homework 1 grading: Not all problems will be graded for correctness. Some problems will be chosen at
random and graded for correctness. The remaining problems will be graded for completeness. 10 points
will be deducted for each problem not fully completed.

Problem Points Possible Points Earned


Completeness
Follow instructions 10

Total 100
1. Fill in the table for the unsigned numbers.

Decimal Binary (4 bit word) Octal Hexadecimal


0 0000 00 0

1 0001 01 1

2 0010 02 2

3 0011 03 3

4 0100 04 4

5 0101 05 5

6 0110 06 6

7 0111 07 7

8 1000 10 8

9 1001 11 9

10 1010 12 A

11 1011 13 B

12 1100 14 C

13 1101 15 D

14 1110 16 E

15 1111 17 F
2. What are the digits of the following number systems?

Example: The digits of a base 2 (binary number system) are 0, 1


The digits of a base 10 (decimal) number system are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

a. Base 5

0, 1, 2, 3, 4

b. Base 8

0, 1, 2, 3, 4, 5, 6, 7

3. What values in a base 4 and a base 9 number system are equivalent to 10102?

224 119

4. Convert to hexadecimal and then convert the hexadecimal number to binary:

Example: 924.812510

Find the hexadecimal value of the integer number to the left of the decimal point, using the
division method.

924 / 16 = Quotient 57, remainder 12

The remainder 12 is the least significant hex digit, filling the 16^0 position. Remember to
convert the decimal value of 12 to its hexadecimal value of C.

C
16^3 16^2 16^1 16^0

Now, divide the quotient 57 by 16 to find the next hex digit.

57 / 16 = Quotient 3, remainder 9.

Decimal 9 is hexadecimal 9. Fill the 16^1 position with the remainder 9.

9 C
16^3 16^2 16^1 16^0

Divide the quotient 3 by 16 to find the next hex digit.


3 / 16 = Quotient 0, remainder 3.

Decimal 3 is hexadecimal 3. Fill in the 16^2 position with the remainder 3.

3 9 C
16^3 16^2 16^1 16^0

We stop dividing when the quotient is 0.

0 / 16 = Quotient 0, remainder 0. If we need to fill in more bit positions to the left, you can see
that all the values would be 0.

0 3 9 C
16^3 16^2 16^1 16^0

We only need 3 hex digits to represent the decimal value 924. Let’s check our result by
converting 39C16 back to decimal.

3 x 16^2 + 9 x 16^1 + 12 x 16^0 = 4 x 256 + 9 x 16 + 12 x 1 = 768 + 144 + 12 = 924

The next step is converting the fractional portion to the right of the decimal point .812510 to
hexadecimal. We do this by multiplying by 16.

0.8125 x 16 = 13.0

The decimal value 13 is hex D. This is the digit immediately following the radix point.

So far, we have 0.812510 = 0.D16

Subtract the 13 from 13.0 and multiply the remaining fraction by 16.

13.0 – 13 = 0.0

0.0 x 16 = 0.0

Now put the integer portion 396 together with the fractional portion .D to form 396.D16

Answer: 924.812510 = 39C.D16

Finally, convert the hexadecimal number to binary. Remember each hex digit convert to 4 binary
bits:

3 9 C . D
0011 1001 1100 . 1101
Answer: 924.812510 = 39C.D16 = 0011 1001 1100 . 11012

Stop when 0.0 is reached, or if a repeating pattern is detected.

Now, complete a – d. Show your work.

a. 757.2510 2F5.416 0010 1111 0100.01002


b. 123.1710 ̅̅̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
c. 356.8910 ̅̅̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
d. 1063.510 427.816 10000100111.12

a. 757.2510

Convert decimal integer 757 to hexadecimal


1510 or
0 0 2 F16 5
16^4 16^3 16^2 16^1 16^0
65536 4096 256 16 1

Check
0 0 512 240 5 757

OR Alternate Division Method to convert the integer:

757 / 256 = Quotient 2, Remainder 245


245 / 16 = Quotient 15, Remainder 15
5 /1 = Quotient 5, Remainder 0

The quotients are in base 10, convert to hexadecimal: 75710 = 2F516

Convert decimal .25 to hexadecimal


Base 10 Base 10 Base 10 Bit Power
0.2500 times 16.00 = 4.0000 4 16^-1
0.0000 times 16.00 = 0.0000 0 16^-2
b. 123.1710

Convert decimal integer 123 to hexadecimal


0 0 0 1210 5
16^4 16^3 16^2 16^1 16^0
65536 4096 256 16 1

Check
0 0 0 192 5 197

OR Alternate Division Method to convert the integer:

123 / 16 = Quotient 12, Remainder 5


5 /1 = Quotient 5, Remainder 0

The quotients are in base 10, convert to hexadecimal: 12310 = C516

Convert the fraction, note the repeating pattern.

Convert decimal .17 to hexadecimal


Base 10 Base 10 Base 10 Decimal Hex Power
0.1700 times 16.00 = 2.7200 2 2 16^-1
0.7200 times 16.00 = 11.5200 11 B 16^-2
0.5200 times 16.00 = 8.3200 8 8 16^-3
0.3200 times 16.00 = 5.1200 5 5 16^-4
0.1200 times 16.00 = 1.9200 1 1 16^-5
0.9200 times 16.00 = 14.7200 14 E 16^-6
0.7200 times 16.00 = 11.5200 11 B 16^-7
0.5200 times 16.00 = 8.3200 8 8 16^-8

Answer:
̅̅̅̅̅̅̅̅̅ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
c. 356.8910

Convert decimal integer 356 to hexadecimal


0 0 1 6 4
16^4 16^3 16^2 16^1 16^0
65536 4096 256 16 1

Check
0 0 256 96 4 356

Convert decimal .89 to hexadecimal


Base 10 Base 10 Base 10 Decimal Hex Power
0.8900 times 16.00 = 14.2400 14 E 16^-1
0.2400 times 16.00 = 3.8400 3 3 16^-2
0.8400 times 16.00 = 13.4400 13 D 16^-3
0.4400 times 16.00 = 7.0400 7 7 16^-4
0.0400 times 16.00 = 0.6400 0 0 16^-5
0.6400 times 16.00 = 10.2400 10 A 16^-6
0.2400 times 16.00 = 3.8400 3 3 16^-7
0.8400 times 16.00 = 13.4400 13 D 16^-8
0.4400 times 16.00 = 7.0400 7 7 16^-9
0.0400 times 16.00 = 0.6400 0 0 16^-10
0.6400 times 16.00 = 10.2402 10 A 16^-11

̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅
d. 1063.510

Convert decimal integer 1063 to hexadecimal


0 0 4 2 7
16^4 16^3 16^2 16^1 16^0
65536 4096 256 16 1

Check
0 0 1024 32 7 1063

OR Alternate Division Method to convert the integer:

1063 / 256 = Quotient 4, Remainder 39


39 / 16 = Quotient 2, Remainder 7
7 /1 = Quotient 7, Remainder 0

The quotients are in base 10, convert to hexadecimal: 106310 = 42716

Convert decimal .5 to hexadecimal


Base 10 Base 10 Base 10 Decimal Hex Power
0.5000 times 16.00 = 8.0000 8 8 16^-1
0.0000 times 16.00 = 0.0000 0 0 16^-2

5. Convert to octal. Convert to hexadecimal. Then convert both of your octal


and hexadecimal answers to decimal and verify they are the same. Show
your work.

a. 111010110001.0112

b. 10110011101.112
a. 111010110001.0112

Convert integer portion from binary to octal,


forming groups of 3, starting from the LSB and moving to the left.

Binary 111 010 110 001


Octal 7 2 6 1

Convert fractional portion .011 from binary to octal,


forming groups of 3, starting with the bit immediately to the right of the binary point. Add
additional zeros to the right if you do not have a full group of 3.

Binary 011
Octal 3

Check the fractional portion conversion: Binary .011 is ¼ + 1/8 = 3/8

Convert integer portion from binary to hexadecimal,


forming groups of 4, starting from the LSB and moving to the left.

Binary 1110 1011 0001


Hex E B 1

Convert fractional portion .011 from binary to hexadecimal,


forming groups of 4, starting with the bit immediately to the right of the binary point. Add
additional zeros to the right if you do not have a full group of 4.

Binary 0110
Hex 6

Answer: Octal 7261.3, Hexadecimal EB1.6, Decimal 3761.375


b. 10110011101.112
10 110 011 101

Convert integer portion from binary to octal,


forming groups of 3, starting from the LSB and moving to the left.

Binary 010 110 011 101


Octal 2 6 3 5

Convert fractional portion .11 from binary to octal,


forming groups of 3, starting with the bit immediately to the right of the binary point. Add
additional zeros to the right if you do not have a full group of 3.

Binary 110
Octal 6

Convert integer portion from binary to hexadecimal,


forming groups of 4, starting from the LSB and moving to the left.

Binary 0101 1001 1101


Hex 5 9 D

Convert fractional portion .11 from binary to hexadecimal,


forming groups of 4, starting with the bit immediately to the right of the binary point. Add
additional zeros to the right if you do not have a full group of 4.

Binary 1100
Hex C

Answer: Octal 2635.6, Hexadecimal 59D.C, Decimal 1437.75


6. Add, subtract, and multiply in binary: (subtract the smaller number from the larger) Show all
your carries and borrows. Show your work.

Example: 111 and 100

Addition

Carry 1 0 0
111 1 1 1
+ 100 1 0 0
Sum 0 1 1

Subtraction

Borrow 0 0
111 1 1 1
-100 1 0 0
Difference 0 1 1

Multiplication

111 1 1 1
X 100 1 0 0

0 0 0
0 0 0 0
1 1 1 0 0

Product 1 1 1 0 0

a. 1111 and 1010

Binary Addition
Carry 1 1 1 0
1 1 1 1
+ 1 0 1 0
Sum 1 1 0 0 1
Binary Subtraction
Borrow
1 1 1 1
- 1 0 1 0
Sum 0 1 0 1

Binary Multiplication
1 1 1 1
x 1 0 1 0
0 0 0 0
1 1 1 1 0
0 0 0 0 0 0
1 1 1 1 0 0 0
Product 1 0 0 1 0 1 1 0
b. 110110 and 11101

Binary Addition
Carry 1 1 1 1
1 1 0 1 1 0
+ 1 1 1 0 1
Sum 1 0 1 0 0 1 1

Binary Subtraction
Borrow 1 1 0 0 1
1 1 0 1 1 0
- 1 1 1 0 1
Diff 0 1 1 0 0 0

Binary Multiplication
1 1 0 1 1 0
x 1 1 1 0 1
1 1 0 1 1 0
0 0 0 0 0 0 0
1 1 0 1 1 0 0 0
1 1 0 1 1 0 0 0 0
1 1 0 1 1 0 0 0 0 0
Product 1 1 0 0 0 0 1 1 1 1 0
c. 100100 and 10110

Binary Addition
Carry 0 0 1 0 0
1 0 0 1 0 0
+ 1 0 1 1 0
Sum 1 1 1 0 1 0

Subtraction, Step 1
Binary Subtraction
Borrow
1 0 0 1 0 0
- 1 0 1 1 0
Diff 0

Subtraction, Step 2
Binary Subtraction
Borrow 1 1
1 0 0 0 0 0
- 1 0 1 1 0
Diff 1 0

Subtraction, Step 3
Binary Subtraction
Borrow 1 1 1
0 1 0 0 10 0
- 1 0 1 1 0
Diff 0 0 1 1 1 0

Binary Multiplication
1 0 0 1 0 0
x 1 0 1 1 0
0 0 0 0 0 0
1 0 0 1 0 0 0
1 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 0 0
Product 1 1 0 0 0 1 1 0 0 0
7. Convert the following decimal numbers to octal and then to binary:
a. 2983 63/64

101110100111.1111112 BA7.FC16
b. 93.70

1011101.101100110011001100110011001100112

135.54631463146314648

c. 1900 31/32

11101101100.111112

3554.768

d. 109.30

1101101.010011001100110011001100110011002

155.23146314631463148

8. How many unique binary combinations can be formed with 7 bits?

27 = 12810
9. What is the range of unsigned decimal numbers that can be represented with 10 bits?

0 to 210 – 1 or 0 to 1023

You might also like