Question

In: Electrical Engineering

Example: A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has...

Example:

A 3-address computer has 40 instructions, 16 Registers, and 256KB memory. Assume each instruction has three operands. Two registers and the third operand is a direct address location of a memory. Find minimum size of PC, MAR, MDR, IR.

Solution:

OPCODE R1, R2, address

OPCODE is 6 bits since 2^6>40

Register field is 4 bits since 2^4 =16

Memory field is 18 bits since 2^18=256K

Instruction length =6+4+4+18=32 bits

MDR=32 bits

IR=32 bits

MAR=18

PC=18

Please explain

Solutions

Expert Solution

We'll analyse the solution line by line.

OPCODE R1, R2, address: As given in the question.

OPCODE is 6 bits since 2^6>40: We need bits so that we can select our complete 40 sets of opcodes for the different operation. Thus, our bits should be at least 40. Consequently, we need minimum 6 bits address.

Register field is 4 bits since 2^4 =16: Our computer has 16 different registers which can be selected, thus we need minimum 4 bits to select 16 different registers.

Memory field is 18 bits since 2^18=256K: Generally, we assume memory organization to be byte-addressable which has also been done here i.e every segment is of one byte and there are total 256K segments. Now, to select 256*1024 different locations we need 2^18 = {256*1024 } bits.

Instruction length =6+4+4+18=32 bits: Thus, our total instruction length becomes 6(opcode) + 2*4(two register bits) + 18(memory address).

MDR=32 bits: Memory data register(MDR) stores the word length of data being transferred. Thus it is 4bytes(1 word in modern architecture) or 32 bits.

IR = 32 bits: it holds the current instruction being executed thus it is equal to instruction length = 32 bits.

MAR = 18bits Memory address register(MAR) stores the memory address which is 18 bits in length as discussed.

PC=18 bits It denotes the point where our computer is, in its program sequence. Also known as PROGRAM COUNTER. Our code is stored in memory thus the program counter will point to a memory address which is 18 bits in length.


Related Solutions

5. On a machine, an instruction is always 16 bits long, and there are 16 registers....
5. On a machine, an instruction is always 16 bits long, and there are 16 registers. There are only two types of instruction supported: dyadic operation, which has 2 operands, and monadic operations, which has only 1 operand. If we want to make sure the machine can support 64 different monadic instructions, then how many dyadic instructions can it support at most? (10%) -------------------------------- 6. Let us assume we have such a machine. The physical RAM has 32 bytes, and...
explain why a computer needs to use memory (registers, stacks, heaps) when executing assembly language instructions...
explain why a computer needs to use memory (registers, stacks, heaps) when executing assembly language instructions using the computer's architecture?
Why would memory indirect addressing (i.e., the instruction contains a memory address A, which in turn...
Why would memory indirect addressing (i.e., the instruction contains a memory address A, which in turn is a pointer to memory location B which contains the value) be difficult to implement on the hardware in Figure 5.8?
Assume that the state of the 8086 registers and memory just prior to the execution of...
Assume that the state of the 8086 registers and memory just prior to the execution of each instruction is given as below: (AX) = 0000 H (BX) = 0010 H (CX) = 0105 H (DX) = 1111 H (SI) = 0100 H (DI) = 0200 H (CF)= 0 (DS:100H) = 0F H (DS:200H) = 22 H (DS:220H) = AA H (DS:221H) = 55 H (DS:400H) = AA H (DS:401H) = 55 H Examine the following instructions independently and calculate the...
Assume that a mad scientist has created a computer that has 9 bit registers. The most...
Assume that a mad scientist has created a computer that has 9 bit registers. The most significant bit is the sign bit. He wants to execute the following operation using 9 bit register. -256-2 Use 2's complement method (in binary) to find the result of the above operation in binary system. Show the computations in the answer.
1- Assume that the state of the 8086 registers and memory just prior to the execution...
1- Assume that the state of the 8086 registers and memory just prior to the execution of each instruction is given as below: (AX) = 0010 H (BX) = 0020 H (CX) = 0030 H (DX) = 0040 H (SI) = 0100 H (DI) = 0200 H (CF) = 1 (DS:100H) = 10 H (DS:101H) = 00 H (DS:120H) = FF H (DS:121H) = FF H (DS:130H) = 08 H (DS:131H) = 00 H (DS:150H) = 02 H (DS:151H) =...
13. A digital computer has a memory unit with 32 bits per word. The instruction set...
13. A digital computer has a memory unit with 32 bits per word. The instruction set consists of 260 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory. a) How many bits are needed for the opcode? b) How many bits are left for the address part of the instruction? c) What is the maximum allowable size for memory? d) What...
A digital computer has a memory unit with 32 bits per word. The instruction set consists...
A digital computer has a memory unit with 32 bits per word. The instruction set consists of 122 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory. a) How many bits are needed for the opcode? b) How many bits are left for the address part of the instruction? c) What is the maximum allowable size for memory? d) What is...
At the initial stage of each instruction cycle, the processor fetches an instruction from memory. The...
At the initial stage of each instruction cycle, the processor fetches an instruction from memory. The processor interprets the instruction and performs the required action. Provide illustration of the process with a thorough explanation on the rudimentary instruction cycles the processor follows to execute fundamental instructions. Discuss how this processor interacts with the cache memory to give output speedily.
i)In a computer, an instruction is composed of two fields: the opcode and an operand address....
i)In a computer, an instruction is composed of two fields: the opcode and an operand address. what is the minimum size of your instruction in bits if an instruction set of 327 opcodes and an address space of 128 Mbytes is required? NB. Use 1 Mbyte = 2^20 bytes ii) Instead of hard-writing the units, the software is used to interpret and execute instructions in a general-purpose system. Is the statement true or false
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT