106 Flashcards

1
Q

What does ALU stand for?

A

An Arithmatic Logic Unit

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

What does an ALU do?

A

> Preforms arithmetic and logical operations on binary numbers
Typically there are 2 input numbers and a single output
Control bits are used to select which operation to carry out on the inputs

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

What is a BUS?

A

An example of a parallel connection

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

What are the conventions for drawing busses?

A

> Thick line
Black Arrows
Single lines crossed with diagonal lines

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

What are some Logic operations that can be accomplished with an ALU?

A

> Bitwise operations
Negation operations
Bit inverse clear operations

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

What are bitwise operations?

A

> Different logic gate functions. e.g. AND, OR etc

> Applied to bit pairs

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

What are negation operations?

A

> Inversion or complementing

> This can be done with logic gates in parallel

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

What are bit inverse clear operations?

A

> This is for ARM Processors
This is used to set any bit in a binary number to 0.
Two inputs: A (Binary number) & B (Used to select which bit is to be set to 0)
How it works:
B is inverted
An AND function is applied to both bits
A.!B

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

What are some Arithmatic operations that can be done on an ALU?

A

> Addition
Subtraction
Most ALU’s will implement a carry look-ahead adder because they are quicker than a ripple adder
Some microprocessors may also have hardware multipliers

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

How is binary subtraction done?

A

> Using ripple adders and 2s complement
If 2’s complement is applied to the second value then the two number can be added together and this produces the subtracted numbers.
Y = A + (-B)
Y = A + B ̅ + 1

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

How can 2’s complement be applied to a binary number for subtraction?

A

The second binary number is inverted (1’s Complement) and then when added with the first binary number the carry in on the ripple adder is set to 1

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

What is the 3rd type of operation that an ALU can preform?

A

A data movement operation

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

What decides what function an ALU preforms?

A

The control bits

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

What do the ALU control bits do?

A

Control various multiplexers in the ALU to route the bus to the correct operation

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

LEARN THE MULTIPLEXER ARCHETECTURE OF AN ALU

A

DO IT

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

What are the common operations of an ALU?

A
> A+B
> A-B
> B-A
> A AND B
> A OR B
> A XOR B
> A AND !B
> B
> !B
17
Q

What are OP codes?

A

> Operation codes

> This is the binary number that controls the ALU and select which operation is to be preformed

18
Q

How are these operations named?

A

With a mnemonic

19
Q

What are the different mnemonics of an ALU?

A
> ADD - A+B
> SUB - A-B
> RSB - B-A
> AND - A AND B
> ORR - A OR B
> BIC -  A XOR B
> EOR - A AND !B
> MOV - B
> MVN - !B
20
Q

What are flags?

A

These indicate particular situations that can occur from preforming an operation on an ALU

21
Q

What are 4 typical flags?

A

C – A final carry-out has been generated
V – Overflow has occurred
N – The ALU output is negative
Z – The ALU output is zero

22
Q

What does the carry flag indicate?

A

> From the final carry out of the ripple adder
This is meaningless when considering signed numbers
This shows that the output number is too large for the ALU

23
Q

What does the overflow flag indicate?

A

> If the result is out of the range for that number of bits then
This is meaningless for unsigned numbers
It occurs when the sign bit changes
Overflow occurs when for the most significant bit, the carry-in and carry-out bits are different

24
Q

What does the zero flag indicate?

A

> To detect whether the output is zero

> This is done by having a NOR gate with multiple inputs connected to the ALU output

25
Q

What does the negative flag indicate?

A

> This is the sign bit of the output bus (most significant bit)
This is irrelevant when considering unsigned numbers
This is also meaningless for purely logical operations