0% found this document useful (0 votes)
17 views5 pages

Homework 1

The document contains examples and exercises for converting between decimal, binary, and hexadecimal number systems. It shows how to convert decimal numbers to binary using the subtraction and division methods. It also contains examples of converting binary to decimal and hexadecimal, hexadecimal to binary, and performing bitwise AND operations on binary numbers.
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)
17 views5 pages

Homework 1

The document contains examples and exercises for converting between decimal, binary, and hexadecimal number systems. It shows how to convert decimal numbers to binary using the subtraction and division methods. It also contains examples of converting binary to decimal and hexadecimal, hexadecimal to binary, and performing bitwise AND operations on binary numbers.
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/ 5

CSE 80n: HW1

Hui Chen

1. Convert decimal 345 into binary using the Subtraction Method. Show all of the steps.

345/2=172, and with 1 reminder

172/2=86, and with 0 reminder

86/2=43, and with 0 reminder

43/2=21, and with 1 reminder

21/2=10, and with 1 reminder

10/2=5, and with 0 reminder

5/2=2, and with 1 reminder

2/2=1, and with 0 reminder

1/2=0, with 1 reminder

The answer is 101011001.

2. Convert decimal 524 into binary using the Division Method. Show all the steps.

524/2=262, with 0 reminder

262/2=131, with 0 reminder

131/2=65, with 1 reminder

65/2=32, with 1 reminder

32/2=16, with 0 reminder

16/2=8, with 0 reminder

8/2=4, with 0 reminder

4/2=2, with 0 reminder

2/2=1, with 0 reminder

1/2=0, with 1 reminder

The answer is 1000001100.

3: Convert the following decimal numbers into 8-bit binary numbers using your preferred method.

Remember to put leading zeros so that your answer has 8 digits.


Decimal 8-bit binary

255 11111111

126 1111110

15 1111

32 100000

147 10010011

4. Convert the following 8-bit binary numbers into decimal.

8-bite binary Decimal

11111111 255

00000000 0

00000001 1

10000000 128

10101010 170

5. What is the decimal value of the largest 10-bit binary number?

210=1024-1=1023

6. Write all the 4-bit binary numbers, starting with 0000:

0000

0001

0010

0011

0100

0101

0110

0111

1000

1001
1010

1011

1100

1101

1110

1111

00010000

00010001

How many 4-bit binary numbers are there?

2x2x2x2=16

How many 3-bit binary numbers are there?

2x2x2=8

7. Write the decimal numbers 0 through 20 in the hexadecimal.

Decimal Hexadecimal

0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F
16 10
17 11
18 12
19 13
20 14

How many binary digits are represented by a single digit in hexadecimal?

8. Convert the following hex numbers into binary.

Hex Binary

E0 11100000

35 00110101

01 0001

10 00010000

AB 10101011

9. Convert the following binary numbers into hex:

Binary Hex

1111 1110 FE

1000 0001 81

0000 1111 F

1010 1011 AB

1100 0111 C7

10. Perform the BITWISE AND of the following sets of binary numbers

You might also like