A 2-address computer has 65 instructions, 32 Registers, 4MB memory, and three flags negative, zero, and positive (N, Z, P). Assume length of each instruction is 32 bits. Find a format for BR instruction
Answer :- The BR instruction is used for
brancing to a particular program location. So with BR instruction
what we need is the address of the memory where we want to
go.
The computer has 65 instructions i.e. for opcode we need atleast 7
bits. Since 27 = 128 if we choose 6 bits then computer
can have only 64 instruction max.
For 4MB of memory we need 22 bits since 222 = 4 x 1 MB =
4 MB.
Thus the instruction format can be-
ZZZZZZZ RRR AA_AAAA_AAAA_AAAA_AAAA
where Z implies the 7-bit opcode, R imples bits are reserved and not being used, and A implies 22-bit address for 4MB of memory. So overall 32-bit instruction. The reserved 3 bits can be used for instruction like BEQ, BNE, BGE etc.
Get Answers For Free
Most questions answered within 1 hours.