Answered step by step
Verified Expert Solution
Question
1 Approved Answer
6. [8 marks] In class (Module 3) you have learned about twos-complement representation of signed integers. In this question we introduce another method of encoding
6. [8 marks] In class (Module 3) you have learned about twos-complement representation of signed integers. In this question we introduce another method of encoding signed integers, called offset-binary. In k-bit offset-binary, the absolute range of integers which can be represented is the same as the range for k-bit two's-complement. However, the smallest (negative) integer is encoded as 000...000, and the largest (positive) integer is encoded as 111... 111. (a) Suppose we are working with 4-bit offset-binary encoding. The integers we can represent lie in the range of (-8, 7). Complete the table below with the map of each 4-bit binary sequence to the corresponding integer in offset-binary as described above. For reference, the map of each binary sequence to an integer encoded as twos-complement has been included for you. binary 2's-comp. offset-bin. 0000 0 1 0001 0010 2 0011 3 0100 4 5 0101 0110 6 0111 7 1000 -8 1001 -7 1010 -6 1011 -5 . 1100 -4 1101 1110 1111 -1 (b) Observe the entries in your table above and compare the individual offset-binary integers to their two's complement counterparts. Briefly describe how to convert a binary sequence representing an offset-binary integer, to a binary sequence repre- senting the same integer encoded as two's-complement. = c) Offset-binary encoding has an advantage that consecutive integers are encoded using consecutive ordered binary sequences, but a disadvantage is that some convenient mathematical properties such as ease of addition and subtraction are lost. Design a digital circuit which performs the addition of two 4-bit offset-binary se- quences A d302aja, and B = b3bab bo, and produces a 4-bit offset-binary sum S = $3828190. Based on the property you observed in part 6b), this can be easily achieved by converting to two's-complement, performing two's complement addi- tion, and converting the result back to offset-binary. For this exercise though, you may use logic gates, unsigned adders, and multiplexers of any size and data width, but do not convert your values to two's-complement. Work with the proper- ties of the offset-binary encoding to produce the required result directly. To inspire your design, consider what the binary results should be for operations such as 2+5, 4+(-1), 0+0, 3+(-7), etc. Your system may produce any output if the true sum is outside of the range of (-8, 7). Include notes to explain the purpose of each part of your circuit. NOTES: your circuit may be easier to read and test, and more compact if your input/output pins are 4 bits wide. In Logisim, place a pin on the canvas, select it, and change its 'Data Bits' attribute in the left menu to 4. The signal line pulled from the pin now carries 4 bits. To access individual bits, use a 'Splitter device found in the 'Wiring component set. HINT: besides input/output pins, splitters, and constant values, our solution uses only three other components. 6. [8 marks] In class (Module 3) you have learned about twos-complement representation of signed integers. In this question we introduce another method of encoding signed integers, called offset-binary. In k-bit offset-binary, the absolute range of integers which can be represented is the same as the range for k-bit two's-complement. However, the smallest (negative) integer is encoded as 000...000, and the largest (positive) integer is encoded as 111... 111. (a) Suppose we are working with 4-bit offset-binary encoding. The integers we can represent lie in the range of (-8, 7). Complete the table below with the map of each 4-bit binary sequence to the corresponding integer in offset-binary as described above. For reference, the map of each binary sequence to an integer encoded as twos-complement has been included for you. binary 2's-comp. offset-bin. 0000 0 1 0001 0010 2 0011 3 0100 4 5 0101 0110 6 0111 7 1000 -8 1001 -7 1010 -6 1011 -5 . 1100 -4 1101 1110 1111 -1 (b) Observe the entries in your table above and compare the individual offset-binary integers to their two's complement counterparts. Briefly describe how to convert a binary sequence representing an offset-binary integer, to a binary sequence repre- senting the same integer encoded as two's-complement. = c) Offset-binary encoding has an advantage that consecutive integers are encoded using consecutive ordered binary sequences, but a disadvantage is that some convenient mathematical properties such as ease of addition and subtraction are lost. Design a digital circuit which performs the addition of two 4-bit offset-binary se- quences A d302aja, and B = b3bab bo, and produces a 4-bit offset-binary sum S = $3828190. Based on the property you observed in part 6b), this can be easily achieved by converting to two's-complement, performing two's complement addi- tion, and converting the result back to offset-binary. For this exercise though, you may use logic gates, unsigned adders, and multiplexers of any size and data width, but do not convert your values to two's-complement. Work with the proper- ties of the offset-binary encoding to produce the required result directly. To inspire your design, consider what the binary results should be for operations such as 2+5, 4+(-1), 0+0, 3+(-7), etc. Your system may produce any output if the true sum is outside of the range of (-8, 7). Include notes to explain the purpose of each part of your circuit. NOTES: your circuit may be easier to read and test, and more compact if your input/output pins are 4 bits wide. In Logisim, place a pin on the canvas, select it, and change its 'Data Bits' attribute in the left menu to 4. The signal line pulled from the pin now carries 4 bits. To access individual bits, use a 'Splitter device found in the 'Wiring component set. HINT: besides input/output pins, splitters, and constant values, our solution uses only three other components
Step 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