6. Single-Cycle Processor Design Flashcards

1
Q

What are the main functions of the processor?

A
  • fetch instruction from instruction memory
  • read the register operands
  • use the ALU for computation
  • access data memory for load/store
  • store the result of computation or loaded data into the destination register
  • update the PC.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What occurs in the instruction fetch?

A

The program counter is read, and is incremented by 4.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

After the instruction fetch, how is an R-format instruction executed?

A

The instruction is decoded, and the data is passed to the ALU to operate on the data. The result is then written to a register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

After the instruction fetch, how is a load instruction executed?

A

The instruction is decoded, and the load address is calculated using 16-bit offset.

Read the memory, and update the destination register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

After the instruction fetch, how is a write instruction executed?

A

The instruction is decoded, and the write address is calculated using a 16-bit offset.

Write the memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

After the instruction fetch, how is a branch instruction executed?

A

The instruction is decoded, registers are read and passed to the ALU to subtract and compare to zero.

Sign-extend the immediate, shift-left to word align and add to pc+4.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In a R-format instruction, which control lines are set?

  • RegDst
  • ALUSrc
  • MemtoReg
  • RegWrite
  • MemRead
  • MemWrite
  • Branch
  • ALUOp
A
  • RegDst: 1
  • ALUSrc: 0
  • MemtoReg: 0
  • RegWrite: 1
  • MemRead: 0
  • MemWrite: 0
  • Branch: 0
  • ALUOp: 01 (Depends)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In a lw instruction, which control lines are set?

  • RegDst
  • ALUSrc
  • MemtoReg
  • RegWrite
  • MemRead
  • MemWrite
  • Branch
  • ALUOp
A
  • RegDst: 0
  • ALUSrc: 1
  • MemtoReg: 1
  • RegWrite: 1
  • MemRead: 1
  • MemWrite: 0
  • Branch: 0
  • ALUOp: 00 (add)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In a sw instruction, which control lines are set?

  • RegDst
  • ALUSrc
  • MemtoReg
  • RegWrite
  • MemRead
  • MemWrite
  • Branch
  • ALUOp
A
  • RegDst: X
  • ALUSrc: 1
  • MemtoReg: X
  • RegWrite: 0
  • MemRead: 0
  • MemWrite: 1
  • Branch: 0
  • ALUOp: 00 (add)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In a branch instruction, which control lines are set?

  • RegDst
  • ALUSrc
  • MemtoReg
  • RegWrite
  • MemRead
  • MemWrite
  • Branch
  • ALUOp
A
  • RegDst: X
  • ALUSrc: 0
  • MemtoReg: X
  • RegWrite: 0
  • MemRead: 0
  • MemWrite: 0
  • Branch: 1
  • ALUOp: 01 (sub)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly