Miscellaneous Flashcards

1
Q

Compare RISC (7) and CISC (7)

A

RISC:
- Reduced instruction set computer
- Fixed length instruction
- Very simple instructions (compilers, HLL)
- Load/store architectures
- More registers - instructions operate either on registers or memory, not both
- Less complex to implement in hardware, leaving more room for registers
- instructions completes in one single cycle

CISC:
- Complex instruction set computer
- Variable length instruction (Memory restrictions)
- Instructions can operate directly on data in memory (few registers)
- More complex instructions - each single instruction handle more complicated operations (Goal of architecture is to complete a task in fewest lines of assembly as possible)
- Instructions closely resembles operations in HLL
- Emphasis on building complex instructions in hardware
- multi-cycle completion

Arithmetic instructions in CISC can have their operands in memory, whereas arithmetic
instructions in RISC must have their operands in registers.

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

What is the formula for execution time?

A

instruction count * CPI * cycle time

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

What is the formula for Avarage memory access time (AMAT)?

A

(hit-rate * hit-time) + (miss-rate * miss-latency)

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

Compare exceptions, interrupts and traps

A

All of them make CPU jump out of normal execution

Interrupts:
- Caused by external device (e.g. I/O)
- Interrupt handler defining how CPU will act on interrupt
- prioritized

Exceptions:
- Caused by program execution (errors, wrongful execution)
- Handled the same as interrupts
- prioritized

Traps:
- Software generated
- Syscalls

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

What is dual-mode operation in an OS?

A

Dual-mode operation allows the kernel to access memory of user processes, but prevents user
processes from accessing memory of the kernel.

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

Give examples of program state that is stored on a context switch

A

Operating system must maintain a process’s Program Counter, Stack Pointer, and Register values when
the process is not running.

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

Which of the following is defined by Instruction Set Architecture (ISA)?
Register width (i.e. number of bits in a register)
Number of pipeline stages
Number of sets in the cache
The cache miss latency

A

the register width

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

You have a simple microcontroller, and all of its pins have been used to connect to the power
supply and other external components. Your code running inside the microcontroller does not
work as expected. Which of the following mechanisms can be used to debug the issue?

A

Run it in a simulator

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

Describe the difference between cooperative scheduling and preemptive scheduling.

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

What is cooperative scheduling?

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

State advantages and disadvantages of cooperative scheduling and preemptive scheduling.

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

Describe the process of memory mapping a file or device I/O into a process’ virtual address
space in Linux systems.

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

When can you use a stub debugger?

A

When you have a spare serial port.

Requires a few kB of flash memory

Needs to hook into some interrupts

Need a few pins available to access to UART and SPI for communication

A stub debugger is a small piece of code that can be installed on the device

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

When can you use simulators for debugging?

A

Does not need any hardware

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

When can you use JTAG for debugging?

A

Standard protocol for debugging a chip using only a few wires. These pins are often separate from the normal I/O pins.

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

What is the sub-threshold leakage current?

A

Th electrons that flow between drain and source, even when there are no channel between them in the transistors.

17
Q

What is gate-leakage?

A

Current that flows between gate and body, even though there is an insulator underneath the gate.

18
Q

Junction leakage

A

Current that goes from drain to body

19
Q

What is the formula for static power?

A

P_statis = Vdd * I_static

Vdd: Supplied voltage
I_static: The value of the sum of all leakage currents

Leakage currents: Sub-threshold leakage, gate-leakage and junction leakage

20
Q

What are the hardware techniques to reduce power consumption?

A

Clock gating
Power gating

21
Q

What are the software techniques to reduce power consumption?

A

Sleep modes
DVFS

22
Q

What is clock gating?

A

Sets frequency to 0 for circuits not in use using an enable signal through an AND gate.

Digital circuits change state on falling/rising-edge of clock

23
Q

What is power gating?

A

Turn off power supply to circuit not in use. Removes static- and dynamic power supply.

Turn off using a sleep signal.

24
Q

What are sleep modes?

A

Power modes controlled by the OS. The OS can put a system into sleep modes.

Very similar to power gating in hardware, just in software.

There are multiple levels of sleep modes that have various level of trade offs between overhead and power savings.

25
Q

What is DVFS?

A

The OS can choose between multiple voltages and frequencies.

OS needs to adjust voltage and frequency such that the CPU runs just fast enough to meet its deadlines. This way we meet the deadlines with minimum power consumption.

26
Q

How does DMA work?

A

DMA is a feature that uses a DMA controller to manage communication between I/O devices and main memory, thus freeing up the CPU. The CPU initializes bulk transfers by providing the DMA controller with the starting source and destination addresses, the number of bytes to transferred, and control messages like initiate transfer etc. The DMA controller sends an interrupt to the CPU when the data transfer is finished.

27
Q

How does virtual memory solve the issue of safety?

A

Safety: Virtual memory solves the safety issue by controlling what pages can be accessed by each application. It does so by means of permission bits on each page which control read, write and execute permissions to that page. In general, user space applications are not allowed access memory from OS/kernel space. Also, an application does not usually have access to memory pages of other applications. OS, in contrast, can access memory pages of applications.

28
Q

What is stored in the different memory regions?

A

Stack: It is used to store local variables of a function, function parameters, return address, caller-save registers, and callee-save registers.

Heap: It is used to store dynamically allocated variables and is managed by programmers using malloc and free in C.

Static Data: It stores global and static variables.
Instruction/Code: It stores the instructions of the program.

29
Q

Difference between general purpose computer and embedded systems?

A

Additional performance is not necessarily a good thing for embedded systems, because they have fixed performance criteria.
General purpose can run additional applications with additional performance.

Embedded systems optimize design after worst case performance criteria, general purpose looks at best avarage performance.

General purpose machines are often computers, whereas embedded systems are built into other objects such as cars, washing machines, etc.

Embedded systems cannot be programmed by the end user, general purpose computers can.

Embedded systems are built to run specific, and few, applications that are know during design. General purpose machines are built to be able to run a lot of various applications.

30
Q

Property of micro controller

A

Less transistors so cheaper.

A small computer
CPU, RAM, program storage, peripherals (ports, clocks, DAC/ADC, GPIO, other)

All components are on a single chip

Micro controller has weaker performance, but uses far less power.
Low transistor count and because of this really cheap.

Limited pluggability (keyboard, …) and peripherals