206k views
5 votes
Design (draw a datapath) for a block that will help your processor decide whether to take a branch for different conditions. As input, your block will be given an opcode for the type of branch and signals from the ALU which perform the actual comparisons. Your block will produce a single signal branch as output.

Inputs:
• zero - 1 if R[rs1] - R[rs2] = 0, 0 otherwise
• lt - 1 if R[rs1] < R[rs2], 0 otherwise
• opcode (2b) - 00: beq (==), 01: bne (!=), 10: blt (<), 11: bge (>=)

Output:
• branch - 1 if branch should be taken, 0 if not

User Kadie
by
6.4k points

1 Answer

4 votes

Answer:

See explaination

Step-by-step explanation:

Here are the steps taken to draw the diagram!

opcode0 and the opcode1 signals are inverted/not to determine the case whether it is 00, 01, 10, 11.

Then they are 'and'ed with the corresponding Zero/lt signal to confirm if the case is true, for eg. zero = 1 if opcode = 00 (beq).

Then all the cases are 'or'ed to get the Branch signal!

See attachment for the diagram

Design (draw a datapath) for a block that will help your processor decide whether-example-1
User Dhaval Chheda
by
7.6k points