Microcontrollers Flashcards

1
Q

What is a CPU?

A

A single integrated circuit that takes an input, stores it in memory and gives an output.

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

What does a single integrated circuit mean?

A

All components on a single piece of silicon

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

What is the CPU responsible for?

A

Receiving inputs
Storing info in memory
Manipulating info
Outputting their results

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

What is VLSI?

A

Very Large Scale Integration, putting many different boolean gates on a single chip

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

What is contained in a CPU?

A

ALU (Arithmetic Logic Unit)
Registers
Memory Arrays
Counters

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

What does the ALU do?

A

The 4 basic mathematical operations
Comparisons > ,< ,=
Shifters (exactly what it sounds like)
Rotators

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

What is the role of the register (v basic)?

A

A place to store data close to the CPU

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

What are the memory arrays composed of?

A

RAM and ROM

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

What is non-volatile memory?

A

It remains even after the device is powered off. ROM

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

What is the instruction set?

A

Commands like programming languages, such as “add” or “subtract”.

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

What information does a programmer need about the processor?

A

The instruction set and the location of the memory.

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

What is the difference between a CPU and a microcontroller?

A

A CPU is useless by itself, requiring RAM a system bus etc…
A microcontroller has everything it needs to function on a single piece of silicon.

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

How does a CPU work?

A

It controls the voltage supplied to other components through the system bus.

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

What is the system bus?

A

A group of parallel wires.

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

What is CISC?

A

Complex Instruction Set Computer

A RISC that has had a bunch of additional instructions added onto it over time for convenience

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

What is a RISC?

A

Reduced Instruction Set Computer

It has a small amount of simple instructions

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

What are the +ves and -ves of a CISC?

A

+ Compatibility
- Slower
- Requires more complex hardware

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

What are the +ves and -ves of a RISC?

A

+ Faster
+ Easier to design hardware
+More efficient hardware
- Becomes a CISC
- Limited Instruction set

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

What is the register?

A

The fastest memory that the CPU can directly access.

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

What is the cache?

A

Memory that is faster to access than the RAM/ROM but slower than the register.

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

What does the programme counter do?

A

It marks the address of the current instruction being carried out and then consecutively stores the next.

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

What is timing?

A

The speed at which the CPU executes instructions. It synchronises all the logic components.

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

What are the characteristics of the Von Neuman Architecture?

A

The CPU is connected to memory by a single bus
The program and Data memory are stored in one place.

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

What are the +ves and -ves of the Von Neuman Architecture?

A

+ A single address
+Can compile it’s own software
- Single Bus

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

Why can the Von Neuman Architecture compile its own software?

A

It treats instructions as data making it possible for it to programs to write programs.

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

Why is having a single address good?

A

Data and program instructions can be found and described by a simple memory map.

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

Why is having a single bus bad?

A

The program and data instructions must wait for one to finish before the other can start. The CPU can work faster than it takes for this to happen so it gets bottlenecked.

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

What are the characteristics of the Harvard architecture?

A

The Data and Program memory are stored separately with separate buses and addresses.

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

What are the +ves and -ves of the Harvard Architecture?

A

+ Program and Data memory are stored separately, making it faster in some situations.
+ Program and Data memory can be of different sizes (different data word lengths)
- Cannot download new programmes
- More complex

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

What is ASCII?

A

A method using 7 bits to encode letters of the Western alphabet.

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

What is Unicode?

A

A method of using binary encoding multiple alphabets.

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

What is a Status flag?

A

Special bits contained in the register that describe the previous process in the ALU.

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

Zero flag?

A

Has a value of 1 if the previous calculation was 0. (NOR of every result)

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

Carry flag?

A

C has a value of 1 if the result cannot fit into the number of allowable bits.

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

Overflow flag?

A

ONLY WITH SIGNED INTEGERS
if the calculation carries into the last bit (the -ves one) then the carry flag is 1.

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

How can you calculate if there has been an overflow?

A

By XORing the top two carry bits from the calculation

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

Negative (sign) flag?

A

is 1 if the last operation was negative.

38
Q

Half Carry flag?

A

Set 1 if there has been a carry in the first 4 bits into the second 4 in a calculation.

39
Q

Parity Flag?

A

Determines whether the number is odd or even.

40
Q

What instructions can the ALU carry out?

A

Add +
Subtract -
Comparison >,=,<
Negate (make negative)
Logic
Shift
Rotate
Multiply
Divide
SIMD

41
Q

How does Comparison work?

A

Subtract the 2 numbers and see whether the result is positive or negative

42
Q

How does Negate work?

A

0-number = - number

43
Q

What is Logic?

A

You can do AND, OR,NOT and XOR ect

44
Q

What does shift do?

A

Takes a source and moves all the bits left(*2) or right(/2)

45
Q

What does rotate?

A

Moves the leftmost bit to the furthest right or the other way around.

46
Q

What is SIMD?

A

Singe Instruction Multiple Data
Do the same instruction to a lot of bits.

47
Q

What is opcode?

A

What to do

48
Q

What are modifiers?

A

Minor changes to the operation.

49
Q

What are operands?

A

What to do with the chain of bits

50
Q

What is 32-bit MIPs?

A

An architecture that conforms to 3 types R ,I and J

51
Q

What are rs and rt?

A

They are source (meaning where something comes from) registers.

52
Q

What is rd?

A

The destination register

53
Q

What does “shamt” do?

A

Shift Amount which, gives the number of bits to shift operations

54
Q

What does “funct” do?

A

Give further refinement to the instruction

55
Q

What are R-type instructions?

A

Arithmetic instructions

e.g “ADDU rd, rs, rt” adds rs and rt and puts it in rd

U at the end means unsigned

56
Q

What are I-type instructions?

A

Immediate, meaning that it uses 1 register as an input.

rs rd immediate

57
Q

What are J-type instructions?

A

The target will correspond to the address of the instruction that should be executed next.

target

58
Q

What are byte-type instructions?

A

Arithmetic and logical instructions where the input is data in the file register.

W (accumulator) used if another input is needed

59
Q

What are bit type instructions?

A

Allows individual bits within the register to be accessed

60
Q

What are literal-type instructions?

A

Uses the accumulator and literal value for arithmetic like instructions

61
Q

What are control-type instructions?

A

Use of the target field to specify a new instruction address

62
Q

What is the “word size” / data word?

A

The standard size of an ALU operation and usually the size of an instruction (if not Harvard architecture)

63
Q

What is an operand?

A

Input arguments of the operation

A and B are the operands of A+B = C

64
Q

What is memory-memory architecture?

A

It uses the large number of binary addresses in the memory for the operands to perform the operation

65
Q

What is load/store (register-register) architecture?

A

Data is loaded from memory into registers and then the operation refers to the register instead of the entire memory.

66
Q

How does overwriting the input data shorten the instruction length?

A

It forces the one source to be the working register, W aka the accumulator

67
Q

What is a stack?

A

A special block of memory that is reserved for saving data that will be used later.

68
Q

How does a stack work?

A

The first thing in is the last thing out, like a stack sorted from top to bottom

69
Q

What are implicit/implied operands?

A

The instructions already know what it needs to do without being told more

70
Q

What is Immediate Addressing?

A

The operand is given directly to the instruction, you specify the exact value used

71
Q

What is Direct Addressing?

A

The instruction gives the exact memory address where the operand can be found.

72
Q

What is Indirect Addressing?

A

The instructions tell the computer where to find the address for the data.

73
Q

What is relative addressing?

A

It starts with the first item in the array and then goes to the next one.

74
Q

What is the program counter?

A

It moves the next instruction automatically after the previous one has been executed.

(unless a specific command causes it to skip some)

75
Q

What is pipelining?

A

The computer is already fetching the next instruction while executing the current one

76
Q

What is a potential problem with pipelining?

A

If a branch or jump occurs, the computer discards the next fetched instruction.

77
Q

What are the 3 types of branches?

A

Unconditional Branch
Conditional Branch
Data Dependent Branch

78
Q

What is the unconditional branch?

A

Always jumps to a specific instruction no matter what

79
Q

What is the conditional branch?

A

Jumps only if a specific condition it true

if, for and while loops

80
Q

What is a Data Dependent Branch?

A

Decisions depend on data. For example, in an “if-else” statement

81
Q

What is absolute addressing?

A

The instructions tell the computer exactly where to jump.

82
Q

What is relative addressing?

A

Instead of giving the exact address, the instruction tells the computer to go forward or backwards by a certain number of steps

83
Q

What is the problem and solution to absolute addressing?

A

The instructions don’t always have enough space to include the full address.
so

Use tricks like splitting the address across two registers (as in PIC microcontrollers or MIPS).

84
Q

What is the benefit of relative addressing?

A

It’s more compact (takes up less space).

The code can work no matter where it’s stored in memory (relocatable).

Useful for loops!

85
Q

What are skips?

A

Instead of jumping far, skip instructions let the computer “skip over” the next instruction if a condition is true.

86
Q

What are subroutines?

A

Functions, you can call them in to avoid repeating the same code

88
Q

What are interrupts?

A

Interrupts let the computer respond to events (like pressing a button) without waiting in a loop.

89
Q

How are interrupts handled?

A

The processor stops what it’s doing and runs a code called the interrupt handler.

90
Q

What are exceptions?

A

Exceptions are like interrupts but happen when something goes wrong in the program. Like dividing by 0.

91
Q

How are exceptions handled?

A

The processor stops and runs a special code called the exception handler. OR it crashes