EECS 31/CSE 31/ICS 151 Homework 1 Questions with Solutions
View Questions Only
View Questions with Strategies
Problem 1
Question
(Number conversion) Give the binary equivalents of the following hexadecimal numbers.
- 123.45
- 1000.50
- BAD.CAB
- DA7.35C
Solution
- 1 0010 0011.0100 0101
- 1 0000 0000 0000.0101
- 1011 1010 1101.1100 1010 1011
- 1101 1010 0111.0011 0101 11
Problem 2
Question
(Number conversion) Find the decimal equivalents of the following radix-7 numbers.
- 606
- 123
- 6650
- 345.6
Solution
- 300
- 66
- 2387
- 180.86
Problem 3
Question
(Addition rules) Add the following numbers without converting them to decimal representations.
- 01110(binary) and 110011(binary)
- 98A(base 12) and 234 (base 12)
- ABC(Hexadecimal) and A78(Hexadecimal)
Solution
- 1000001
- 1002
- 1534
Problem 4
Question
(Subtraction rules) Perform binary subtraction by taking the two's complement of the subtrahend.
- 101110-10001
- 111111-11110
- 11110-1001
- 100001-10001
Solution
- 11101
- 100001
- 10101
- 10000
Problem 5
Question
(Multiplication rules) Perform binary multiplication with the following two's complement numbers.
- 011011 * 0011
Solution
- 1010001
Problem 6
Question
(Division rules) Divide the following binary numbers.
- 11011/1001
Solution
- 11
Problem 7
Question
(Division algorithms) Define the procedure and draw the flowchart for the division of:
- Sign-magnitude binary numbers.
Solution
-
signed division:
-
Perform unsigned division on magnitudes
Problem 8
Question
(Floating-point algorithms) Define the procedure for:
- adding
- multiplying
Solution
-
adding: (change the second'shift>0?'(lower one) to ' MantA>=MantB?')
-
multiplying: