Question: Two easy questions about computer system (3) (a) In class, we examined an algorithm to generate the 2'sC of an integer (flip all bits; add
Two easy questions about computer system

(3) (a) In class, we examined an algorithm to generate the 2'sC of an integer (flip all bits; add 1). We also saw how any number in binary can be directly represented in hex. Work out an algorithm that takes a number in hex and directly obtains its 2'sC representation in hex (e.g. 0xBEEF + 0x4111). Justify your answer - i.e. give reason(s) why your algorithm works correctly. (b) The following bit pattern, 0.xCOD was found in a 12-bit register. What is the decimal number represented if it is interpreted as: (i) unsigned binary; (ii) sign-magnitude; (iii) Two's complement? (4) The CPU of a computer has a memory unit with 32-bit words. The ISA for the processor has 110 instructions. All instructions are stored in one memory word. Instructions have an op-code and two address fields: one for a memory address and one for a register address. The chip has 8 user-addressable registers. (a) How many bits are required to specify (i) the op-code (ii) the registers (iii) memory address in the instruction? (b) What is the maximum allowable size of the memory? (3) (a) In class, we examined an algorithm to generate the 2'sC of an integer (flip all bits; add 1). We also saw how any number in binary can be directly represented in hex. Work out an algorithm that takes a number in hex and directly obtains its 2'sC representation in hex (e.g. 0xBEEF + 0x4111). Justify your answer - i.e. give reason(s) why your algorithm works correctly. (b) The following bit pattern, 0.xCOD was found in a 12-bit register. What is the decimal number represented if it is interpreted as: (i) unsigned binary; (ii) sign-magnitude; (iii) Two's complement? (4) The CPU of a computer has a memory unit with 32-bit words. The ISA for the processor has 110 instructions. All instructions are stored in one memory word. Instructions have an op-code and two address fields: one for a memory address and one for a register address. The chip has 8 user-addressable registers. (a) How many bits are required to specify (i) the op-code (ii) the registers (iii) memory address in the instruction? (b) What is the maximum allowable size of the memory
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
