Organization of Computers Midterm

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/69

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

70 Terms

1
New cards

What two things can a computer do?

Store state and manipulate state

2
New cards

How many bytes (byte-addressable) can a k-bit address specify?

2^k

3
New cards

What is a register file?

A synchronous RAM

4
New cards

What is the write data port in the register file?

The data that will be written

5
New cards

What is the write address port in the register file?

The location the data will be written to

6
New cards

We need to build a RAM that can store 128, 64-bit words and
has one write port and three read ports
How many address bits does my RAM need for its write port?

7

7
New cards

We need to build a RAM that can store 128, 64-bit words and
has one write port and three read ports
How many data bits does my RAM need for each read port?

64

8
New cards

What are the 3 parts of a register file?

  1. The Storage: An array of registers

  2. The Read Ports: Output the data of the register indicated by read addresses

  3. The Write Port: Selectively write data to the register indicated by write address

9
New cards
term image

5

10
New cards

How many registers does a 4 × 16-bit register file have?

4 registers (2 bits)

11
New cards

How many data bits does a 4 × 16 register file have?

16 bits

12
New cards

What is the key feature that distinguishes a computer processor from other digital systems?

Programmability

13
New cards

What is a processor?

A hardware system controlled by software

14
New cards

What is an Instruction Set Architecture?

Describes the interface between the software and the hardware. ISA specifies what operations are available. ISA specifies the effects of each operation.

15
New cards

What do instructions consist of?

Operation code: names the operation to perform

Operands:Names the data to operate on

16
New cards

What are register instructions?

R-Type. Require all values to be stored in registers

17
New cards

What is the size of the MIPS register file?

32 × 32 bits

18
New cards

add $14, $18, $3

Which registers are being added together, and in what order?

$18 + $3

19
New cards

add $14, $18, $3

Which register stores the result?

$14

20
New cards

add $14, $18, $3

What is another name for $18?

rs

21
New cards

add $14, $18, $3

What is another name for $3?

rt

22
New cards

add $14, $18, $3

What is another name for $14?

rd

23
New cards

What are I-Type Instructions?

These instructions allow you to specify an immediate value for the second source instead of a register

24
New cards

addi $15, $1, 4

Which values are being added together, and in what order?

$1 + 4

25
New cards

addi $15, $1, 4

Which register stores the result?

$15

26
New cards

addi $15, $1, 4

What is another name for $15?

rt

27
New cards

addi $15, $1, 4

What is another name for $1?

rs

28
New cards

How could a constant be written to a register?

addi $15, $0, 4

29
New cards

How does sign extension work?

The most significant bit of the input is used to extend the number of bits to represent that value

30
New cards

Where are values store in an I-Type Instruction?

rt

31
New cards

Where are values stored in an R-Type instruction?

rd

32
New cards

What are valid addresses for MIPS Instructions?

0,4,8, 12, etc

33
New cards

What is the Program Counter (PC)?

The PC contains the address of the next instruction to execute

34
New cards

Why can the 2 LSb's of the PC be neglected?

Since the only valid instruction addresses are divisible by 4, the first 2 bits will always be 00

35
New cards

Explain the format of the jump instruction

j target_label. Uses a label to tell where in the code to jump to

36
New cards

How many bits are allotted for the address in a J-Type instruction?

26 bits

37
New cards

Where do the other 6 bits come from for the address in a J-Type instruction?

The bottom two bits are always 00 and the 4 MSb’s are the MSb’s of the PC

38
New cards

What is the format for beq? And what is the comparison?

beg rs, rt, target_label

R[rs] == R[rt]

39
New cards

What type of instruction are branch instructions?

I-Type

40
New cards

How is the target label_stored in branch instructions

The constant field is not an address, but an offset from the current PC to the target address.

41
New cards
<p>What is the value stored in L?</p>

What is the value stored in L?

3, Since the PC points to the next instruction, you dont count' from the instruction being run, but from where the PC is pointing

42
New cards
<p>How many bits is the PC incremented by to reach label L?</p>

How many bits is the PC incremented by to reach label L?

3×4 = 12 bits. The PC moves forward 12 bytes in memory

43
New cards

What is the range of the j instruction?

256 MB

44
New cards

Why would you want to use the jr instruction?

If you want to jump outside the bounds of the j instruction

45
New cards

What is another name for the register that is used in jr?

rs

46
New cards

How does jr allow you to leave the bounds established by j?

jr is provided with a register. This register contains an address to jump to. Allows you to fill the entire register with the desired address

47
New cards

What type of instruction is jr?

R-Type

48
New cards

How large is the immediate in I-Type instructions?

16 bits

49
New cards

What does the lui instruction do?

loads the highest 16 bits of a register with a constant, and clears the lowest 16 bits to 0’s

50
New cards

What is the format of lui?

lui $rt, Imm

51
New cards

What value is stored in $12?

lui $12, 0×3D

ori $12, $12, 0x900

0x003D 0900

52
New cards

What type of instruction is lui?

I-Type

53
New cards

What is the format of slt?

slt rd, rs, rt

54
New cards

What is the format for slti?

slti rd, rs, imm

55
New cards

How much storage does the MIPS architecture have by default?

2^(32) * 8 = 4GB

56
New cards

In data memory, what is the operation if word_we = 0 and byte_we = 0?

Read from the address in ADDR

57
New cards

In data memory, what is the operation if word_we = 0 and byte_we = 1?

Write a byte in ADDR

58
New cards

In data memory, what is the operation if word_we = 1 and byte_we = 0?

Write a word in ADDR

59
New cards

How large is a word in MIPS?

32 bits

60
New cards

What does lw do?

Transfers one word of data from the data memory to a register

61
New cards

What does sw do?

Transfers one word of data from a register into main memory

62
New cards

lw $12, 4($3)

What is another name for $12?

rt

63
New cards

sw $12, 4($3)

What is another name for $12?

rt

64
New cards

lw $12, 4($3)

What is another name for $3?

rs

65
New cards

sw $12, 4($3)

What is another name for $3?

rs

66
New cards

What is the unit of the offset in lw/sw/lbu/sb?

bytes

67
New cards

What does lbu do?

Transfers one byte of data from the data memory to a register and zero extends it

68
New cards

What does sb do?

Transfers one byte of data from a register into main memory

69
New cards

Which byte is transferred in sb?

The LSB

70
New cards