

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Exercises on binary and hexadecimal number systems, including addition, subtraction, multiplication, and conversion between binary, hexadecimal, and decimal. It covers topics such as two's complement, range of numbers, and binary fractions.
Typology: Lecture notes
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Exercises
. 1 10^
. 0
. 1
. 0
Exercises
Exercises Write the following decimal numbers in eight bit two’s complement, do the addition/subtraction, convert your answer back to decimal.
For n bit two’s complement what is the range of numbers you can represent?
Answer: Biggest positive numer is 0
n− 1 ︷ ︸︸ ︷ 11... 1 = 2n−^1 − 1. Negative numbers go
down from −1 =
n ︷ ︸︸ ︷ 1... 11 down to 1
n− 2 ︷ ︸︸ ︷ 00... 0 1 =−^2 n−^1 −1. But negative numbers
can go one lower still: least negative number is 1
n− 1 ︷ ︸︸ ︷ 00... 0 =−^2 n−^1. So range of numbers is [− 2 n−^1 ,+^2 n−^1 − 1].
Exercises Write the following fractions in binary. Use one sign bit and four bits after the binary point.
Convert the following binary fractions to ordinary fractions.
What fractions can be represented as binary fractions with one sign bit and four bits after the binary point? Answer: [− 1 ,+ 15 16 ]