Exam questions Flashcards

1
Q

compared to CISC processors, what two features of RISC processors have that can be directly attributed to Moores Law

A

RISC benefits by
1. having many registers
2. regular ISA

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

how does a microarchitecture relate to an ISA and explain why it is useful to separate the two

A

a microarchitecture is an instance of the ISA

many microarchitectures can exist for a given ISA, giving a range of products (can have different price, power etc) and still be binary compatible

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

state an interesting feature of the exponent

A

it is bias - avoiding the need for negative numbers and simplifies comparisons

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

state an interesting feature of the mantissa

A

it is normalised - simplifies comparisons and allows for a more compact representation

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

one pro and con about 2s complement

A

+ simplifies arithmetic circuits, single 0
- range is asymmetric

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

how does a computer know that a given word is a floating point value, integer of ASCII character

A

it does not

the instructions tell it what to do with a given word

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

what is functional completeness

A

a set of gates sufficient to implement any logical boolean function

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

name the memory hierarchy from smallest to largest

A

registers, cache, memory, disk

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

how is register to cache memory managed

A

software - compiler

there are very few registers, so explicit management is needed.
need global knowledge to manage scarce register resources
no time for decision making

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

how is to cache to main memory managed

A

hardware

cache is not visible to the software
hardware manages them, filling and spilling data from memory

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

how is memory to disk managed

A

software -

operating system manages page movement between disk and memory
OS manages virtual memory page swapping

note that file accesses could also be stated to come from the OS (since is manages disk mappings) or the user (who may give the command to open or save a file,
disk is slow therefore software is good enough

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

what two problems does virtual memory address

A

limited capacity of physical memory
- multiple programs sharing limited physical memory (solved by OS managed paging between memory and disk(TLB))

memory safety
solution is protection bits in OS and TLB that are checked on every memory access

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

which is more expensive - cache miss or TLB miss

A

TLB miss because it involves at least one memory access (same as a cache miss) but also requires a context switch to the kernel to access the page table

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

list the sequence of events associated with the execution of a lw instruction from the perspective of the memory system

A
  1. search the TLB
    1.2. on a miss search the page table
    1.2.3. on a miss transfer block from disk to memory and update the page table
  2. update the TLB with a V to P translation
  3. search the cache
    3.1. on a miss access the memory and update the cache
  4. return the requested word from the cache to the processor
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is the TLB

A

translation lookaside buffer

a address translation table contained in the memory management unit of the CPU
it is small and fast

it is a table of triplets in the form [SB, P, F]
SB - status bits (residence, access, modification - RAM)
P - virtual memory page number
F - physical memory frame buffer

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

why do modern computers have a memory hierarchy rather than a single main memory

A

the hierarchy achieves a better average case time

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

what information is stored on a stack

A

return addresses, passing parameters, saving registers that need to be preserved, keeping local variables

18
Q

what is a microarchitecture

A

An instance of the ISA

many microarchitectures can exist for a given ISA, enabling a range of products with different price / performance / power while being binary compatible

19
Q

explain how the performance of multiprocessor can be improved

A

performance is a function of cycle count and cycle time

decreasing average cycles reduces the cycle count - this is a win if not accompanied by a proportional increase in cycle time

increasing average cycles can be useful to reduce the number of gates per stages hence reducing the propagation delay and hence cycle time

reduction in cycle time must offset increase in average cycle count

20
Q

state the action taken by the operating system in response to a page fault

A

bring in a page from disk and install it in memory
update page table
update TLB

21
Q

state the action taken by the operating system in response to a I/O stall

A

context switch to another process

22
Q

state the action taken by the operating system in response to a load accessing unsafe address

A

kill the process

23
Q

why when an interrupt is being serviced, other interrupts should not be visible to the processor

A

because the EPC and cause registers would be overwritten

24
Q

what is the purpose of dual mode architecture

A

to protect critical system resources
resource mangement
scheduling

25
Q

what trigger switches between the two modes of dual mode architecture

A

into the kernel - exception

back to user mode - eret instruction / special instruction

26
Q

why is dual mode used in MIPS

A

so that user programs cannot access resources or memory allocated to other processes

27
Q

list the four steps in the MIPS exception handling mechanism

A
  1. save the address of the current instruction into the EPC
  2. transfer control to the OS at a known address
  3. handle the exception
  4. return to the user program execution (restore user registers and jump to EPC via eret)
28
Q

state and explain the three steps needed to compute the target jump address (for beq)

A
  1. left shift by two - word align, this increases the addressing range of the offset
  2. sign extend by 16 bits - needed to form a 32 bit value for address calculation
  3. add the shifted sign extended value to PC+4 - compute the final address with respect to PC +4
29
Q

two points on overflow detection

A

if number with opposite signs are added - NO Overflow is possible

if numbers with identical signs are subtracted - no overflow is possible

30
Q

how does locality exist in programs

A

instructions are reused (loops, functions etc)

the program only works on a limited set of data (arrays, temporary variables, objects etc)

31
Q

what unit requires a sequential circuit for its implementation

A

S-R latch

32
Q

name one invalid memory region

A

register file

33
Q

name one thing that is not a sequential cicuit

A

ALU

34
Q

Name four things that impact processor performance

A

cycle time
ISA
cycles per instruction
number of instructions

35
Q

in a processor with caches, an index is used to

A

location the data in a direct mapped cache

36
Q

name two statements about the usage of the stack

A

local variables are automatically allocated there
a function call automatically results in allocation of some stack space

37
Q

tag, offset and index size of 6 bit address

A

2 bits

38
Q

name two mandatory features of a processor

A

control
data path

39
Q

The MIPS ISA provides several features that facilitate function calls. Name any two such features and explain why they are beneficial.

A

JAL instruction, $ra register, registers for passing parameters and return values ($a and $v registers), and support for the stack. In general, stack is the only essential feature. All others are only useful from a performance perspective.

40
Q

Explain how a stack is used in implementing function calls. What information is stored on a stack?
.

A

Keeping track of return addresses, passing parameters, saving registers that need to be preserved, keeping local variables.

41
Q

Name one potential drawback of using a stack as compared to registers for passing function arguments.

A

Stack-based approach involves more instructions (to maintain stack pointer and for pushes/pops), which reduces performance.

42
Q

You are designing a new computer and have to choose between either stack- or register-based passing of function arguments and return values. Would you go with a stack or register-based approach? Explain your choice.

A

Stack, since it’s not limited in the number of arguments and return values.