Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

We wish to add the instruction jal (jump and link). Make any necessary changes to the datapath or to the control signals if needed. You can photocopy figures to make it faster to show the additions. How many product terms are required in a PLA that implements the control for the single-cycle datapath for jal?

Short Answer

Expert verified

The datapath changes are made by changing PC+4 as input to MemToReg multiplexer and changing it to 2-bit control signal. The control signals are changed by expanding two multiplexers. Four product terms are required in a PLA to implement the control cycle for single-cycle datapath for jal.

Step by step solution

01

Define jal instruction

Jump and link (jal) instruction is used for procedure calling. A program counter (PC) contains the address of the instruction that will be executed next. The jal instruction jumps to the jump address and save the address of the next instruction to $ra or $31. The format of the instruction is

jal address

02

Make required changes in datapath to add jal instruction

Thejalinstruction performs the following steps:

  • It takes the value of Mem[PC] and stores it in Instruction word.
  • The value of PC+4 is stored in R[31]
  • The Jump address is stored in PC.

The datapath is changed by making PC+4 as input to MemToReg Multiplexer. The MemToReg signal is changes to 2-bit control signal.

03

Make required changes in control signals to add jal instruction

The changes are required to made in control signals to add jal instruction. Two multiplixer are expanded. A value 31 is added to the multiplexer controlled by RegDst. And multiplexer controlled by MemToReg is expanded to have PC+4 as input. The address control lines for jal are set as follows:

Instruction

RegDst

ALUSrc

MemtoReg

Reg Write

Mem Read

Mem Write

Branch

ALUOp1

ALUOp0

Jump

R-type

01

0

00

1

0

0

0

1

0

0

lw

00

1

01

1

1

0

0

0

0

0

sw

xx

1

xx

0

0

1

0

0

0

0

beq

xx

0

xx

0

0

0

1

0

1

0

J

xx

x

xx

0

0

0

x

x

x

1

JAL

10

x

10

1

0

0

x

x

x

1

The number of product terms for required in PLA are 4 to add control for single cycle data path for jal instruction.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Prove that the two equations for E in the example starting on page B-7 are equivalent by using DeMorgan’s theorems and the axioms shown on page B-7

B.17 [5] <§§B.2, B.3> Show a truth table for a multiplexor (inputs A, B, and S; output C ), using don’t cares to simplify the table where possible .

A.3 Is it ever safe for a user program to use registers \(k0 or \)k1?

Question: First, show the block organization of the 16-bit carry save adders to add these 16 terms, as shown in Figure B.14.1. Assume that the time delay through each 1-bit adder is 2T. calculate the time of adding four 4-bit numbers to the organization at the top versus the organization at the bottom of Figure B.14.1.

A.10 [10] <§§A.6, A.9> Using SPIM, write and test a recursive program for solving the classic mathematical recreation, the Towers of Hanoi puzzle. (This will require the use of stack frames to support recursion.) The puzzle consists of three pegs (1, 2, and 3) and n disks (the number n can vary; typical values might be in the range from 1 to 8). Disk 1 is smaller than disk 2, which is in turn smaller than disk 3, and so forth, with disk n being the largest. Initially, all the disks are on peg 1,

Starting with disk n on the bottom, disk n − 1 on top of that, and so forth, up to disk 1 on the top. The goal is to move all the disks to peg 2. You may only move one disk at a time, that is, the top disk from any of the three pegs onto the top of either of the other two pegs. Moreover, there is a constraint: You must not place a larger disk on top of a smaller disk.

The C program below can be used to help write your assembly language program.

/* move n smallest disks from start to finish using

extra */

void hanoi(int n, int start, int finish, int extra){

if(n != 0){

hanoi(n-1, start, extra, finish);

print_string(“Move disk”);

print_int(n);

print_string(“from peg”);

print_int(start);

print_string(“to peg”);

print_int(finish);

print_string(“.\n”);

hanoi(n-1, extra, finish, start);

}

}

main(){

int n;

print_string(“Enter number of disks>“);

n = read_int();

hanoi(n, 1, 2, 3);

return 0;

}

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free