Question
Hints: On problem 3 on this week's homework, it can be a bit tricky to subtract fixed point binary numbers. The way to attack it
Hints:
On problem 3 on this week's homework, it can be a bit tricky to subtract fixed point binary numbers. The way to attack it is:
- figure out how many binary digits of precision you need to represent the fraction.
- represent both numbers to that level of precision.
- perform the mathematical operation WITHOUT the radix point ("decimal" point); that is, treat them as integers.
- put the radix point back in the answer.
There's also a nice trick to get the 2's complement version of a number:
Realize that n-bit 1's complement representation of -N (i.e. inverting all the bits) is just
(2^n-1)-N
In 8 bits
5 = 00000101
The 1's complement representation of this is
11111010 = 250 = 255-5
The 2's complement representation of a N is
2^n-N = 1's complement + 1
That is, you can take the 2's complement by
- inverting all the bits
- adding 1
Problem 3 Solve the following problems by converting to binary and solving with twos complemement arithmetic. Verify that the answers are correct. a) 67+101 b) 53-33 c) 17-24 d) 7.3+11.55 e) 19.77-8.2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started