Chapter 2 Flashcards

1
Q

What numerical system is used to store all information in a microprocessor? And in computing datasheets?

A

Respectively the binary and hexadecimal systems.

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

What is the simplest type of data number in binary?

A

Unsigned integers.

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

How many unique combinations can N bits represent for unsigned integers? For signed integers?

A

They can both represent 2^n integers, however the range differs:
- Unsigned integers : [0, 2^n - 1]
- Signed integers: [ -2^(n-1), 2^(n-1) - 1]

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

How do you determine the binary code of a negative integer in the two’s complement system?

A

You first need to take the one’s complement by inverting all the bits, and then add 1 to the result.

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

What does the Most Significant Bit (MSB) represent in two’s complement encoding?

A

The MSB is the sign bit:
- 0 = positive number
- 1 = negative number

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

What is a fixed-point number system?

A

System where some of the binary digits represent the numbers before the binary point, and some after.
Where the binary point occurs exactly has to be agreed by the creator and user of the fixed-point number.

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

What system allows very large or small numbers to be represented with high accuracy in binary?

A

Floating point number system; it is comparable to scientific notation, several digits can exist after the decimal point to increase accuracy and the use of the exponent.

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

What is Binary Coded Decimal (BCD)?

A

Numeration system where 4 bits are used to encode each decimal digit (0-9).

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

How is text information stored in binary?

A

Using encoding schemes: encoding each character using ASCII, Unicode…

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

What does ASCII use to encode characters?

A

Simplest scheme: uses 7 bits to encode letters of the western alphabet and various other symbols.

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

What is Unicode? How does it differ from ASCII?

A

More complex scheme: uses up to 32 bits, and currently encodes around 110,000 different characters.
It is able to encode different alphabets and technical symbols —> lots more beyond the ASCII characters.

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

What is the difference between upper- and lower-case letters in ASCII encoding?

A

To convert from an uppercase character ASCII code to its lowercase equivalent, we add Ox20 (hexadecimal) = we flip the 6th bit.

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

How are Boolean true/false values represented in binary?

A

1 = True
0 = False

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

What is a data word in a microprocessor?

A

A block of bits used to store a number, typically 8, 16, 32, or 64 bits.

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

What is the word size of the PIC 16F884A microprocessor?

A

8 bits (a byte).

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

What happens if a word size is too large or too small for the data?

A

Too large: the extra bits will be 0 – essentially unnecessary.
Too small: the word cannot represent the full value of the data, additional bits are needed.

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

How do you extend a signed integer to fit a larger word size? And an unsigned integer?

A

Signed integer: repeat the Most Significant Bit (MSB) to fill the additional bits.
Unsigned integer: add leading zeros to fill the additional bits.

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

What are the two forms of the right shift instruction in the MIPS architecture?

A

1) Shift Right Logical: Replaces the vacant bit with 0 (zero-extension).
2) Shift Right Arithmetic: Repeats the original MSB (sign-extension).

19
Q

To what mathematical operation is a right shift equivalent? And shift left?

A

With unsigned integers:
Shift right = division by 2
Shift left = multiplication by 2

20
Q

What is word-addressable memory?

A

Each memory address corresponds to a word of data.

21
Q

What is byte-addressable memory?

A

Each memory address corresponds to a single byte of data.

22
Q

What is endian-ness in microprocessors? How does it work (name 2 systems)?

A

The order in which bytes are stored in memory:
- Little-endian memory stores the least-significant / littlest byte at the lowest memory address.
- Big-endian memory stores the most-significant byte at the first / lowest memory address.

23
Q

How can endian-ness cause problems?

A

Data transfer between systems with different endian-ness can lead to misinterpretation of byte order.

24
Q

What are status flags?

A

Special bits in the Status Register that provide information about the previous process in the ALU.

25
Q

What does the Zero (Z) flag indicate?

A

It is set to 1 if the result of the previous calculation is zero.

26
Q

How is the Zero flag calculated?

A

It is the NOR of every bit in the result.

27
Q

What does the Carry (C) flag indicate?

A

It is set to 1 if the result cannot fit within the allowable bits or during subtraction if there is a borrow.

28
Q

What does the Overflow (V) flag indicate?

A

It is set to 1 if the result of an operation on signed integers exceeds the range that can be represented.

29
Q

How is an Overflow calculated?

A

By XORing the top two carry bits from an addition/ subtraction.

30
Q

What does the Negative (N) flag represent?

A

It indicates whether the result of the last operation was negative (set to 1) or positive (set to 0) = copy of the sign bit.

31
Q

What is the Half-Carry (H) flag used for?

A

It indicates a carry or borrow from the lower 4 bits to the upper 4 bits during addition, especially useful in Binary Coded Decimal (BCD) operations.

32
Q

What does the Parity flag indicate? What is it useful for?

A

Parity describes whether the number of 1’s in a binary number is odd or even.
Useful for detecting or correcting errors in a communication system.

33
Q

What is the role of the Arithmetic Logic Unit (ALU)?

A

Performs operations on its inputs to create a single output value : two inputs, one destination. Status flags may be affected depending on the processor.

34
Q

What is the “Add with carry” operation in the ALU?

A

Adds two inputs along with the carry input, enabling multi-word operations and producing a new carry output.

35
Q

How is subtraction implemented in the ALU?

A

Achieved by taking the one’s or two’s complement of one input and feeding the inputs to the adder. A “Subtract with carry” operation accounts for the carry/borrow bit.

36
Q

What does the comparison operation do in the ALU?

A

Subtracts one input from the other (Source A - Source B).
Flags provide results like Zero (equal), Carry/Borrow, Negative, or Overflow.

37
Q

How does the negate operation work in the ALU?

A

It creates the two’s complement of a number by calculating { 0 - number } using the subtractor with one input set to zero.

38
Q

What logic operations are provided by the ALU?

A

Standard operations like AND, OR, NOT, XOR are performed bitwise. Additional instructions can test, set, or clear individual bits.

39
Q

What does a shift operation do in the ALU?

A

It moves all bits up or down the word. Left shifts multiply by 2, and right shifts divide by 2, often requiring sign extension.

40
Q

What differs Rotate from Shift in a ALU?

A

In rotation, bits moved off one end are placed in the vacant space at the other end.
Rotate through the carry bit is also possible in some cases.

41
Q

What is the result of multiplying two N-bit numbers in the ALU?

A

It produces a 2N-bit result. Low and high parts may be stored in separate registers. Special Multiply-and-Accumulate (MAC) instructions may be used for signal processing.

42
Q

What happens during division in the ALU?

A

Division produces a result and a remainder, often requiring two destinations. This operation is not always available.

43
Q

What is SIMD (Single Instruction, Multiple Data)?

A

It is a useful type of instruction for when the same operation is to be done on a large set of data points (e.g. increasing the brightness in an image).
They can speed up the performance of computers.