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...
Problem 3. A digital computer has a memory unit with 32 bits per word. The instruction...
Problem 3. 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)...
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?
In a computer instruction format, the instruction length is 16 bits and the size of an...
In a computer instruction format, the instruction length is 16 bits and the size of an address field is 4 bits. Is it possible to have: 15 instructions with 3 addresses, 14 instructions with 2 addresses, 31 instructions with one address, and 16 instructions with zero addresses, using this format? Justify your answer.
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...
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?
Given the following memory values and address instruction with an accumulator. Determine the values with the...
Given the following memory values and address instruction with an accumulator. Determine the values with the following instructions load into accumulator. Word 16 contains 22 Word 18 contains 24 Word 20 contains 26 Word 22 contains 28 Word 24 contains 30 Word 26 contains 32 Word 28 contains 34 i. LOAD IMMEDIATE 16 ii. LOAD DIRECT 16 iii. LOAD INDIRECT 16 iv. LOAD IMMEDIATE 18 v. LOAD DIRECT 18 vi. LOAD INDIRECT 20 vii. LOAD IMMEDIATE 24 viii. LOAD DIRECT...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT