Embedded Previous Exam 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/81

encourage image

There's no tags or description

Looks like no tags are added yet.

82 Terms

1
New cards
  1. What architecture does the Raspberry Pi 4 use?


ARM 8 Cortex-A72

2
New cards
  1. Which processor does the Raspberry Pi 4 use?


Broadcom (BCM) 2711

3
New cards
  1. The RP4 is missing one important function. What?

RTC

4
New cards
  1. Three things the CPU core must do

Manipulate data, be controlled by instructions, move data

5
New cards
  1. What is the clock speed of the RP4?

1.5 GHz

6
New cards

6a. Harvard architecture (4 traits)

Takes more area to implement; highest performance; typically used for on-chip cache; allows simultaneous instruction and data access

7
New cards

6b. Von Neumann architecture (2 traits)

Typically used for main memory; most optimal for processor pinout

8
New cards
  1. In the ARM CPU architecture, the PC is…

A special register that stores the address of the next instruction

9
New cards
  1. What is the most powerful thing a computer can do?

Repeat a set of operations until a condition is met

10
New cards
  1. What language does the ARM8 (or any processor) run?

Binary opcode

11
New cards
  1. Characteristics of ARM RISC architecture

Load/store architecture, 32-bit instructions, primarily CPI = 1

12
New cards

11a. Flowcharts (3 traits)

Symbolic; better for smaller code jobs; too much detail is bad

13
New cards

11b. Pseudocode (3 traits)

Natural text; better for larger code jobs; flexible level of detail

14
New cards
  1. T/F: The primary function of the assembler is to convert readable assembly to binary machine code

True

15
New cards
  1. The makefile… (select all)

Helps with file management; automatically uses the files it needs based on what changed; automates the software building procedure; controls the generation of executables

16
New cards
  1. Primary tools for assembly programming in Linux on the RP4

GCC and GDB

17
New cards

15a. Can be 1 or 0

Bit

18
New cards

15b. 4 bits

Nibble

19
New cards

15c. 8 bits

Byte

20
New cards

15d. 16 bits

Half word

21
New cards

15e. 32 bits

Word

22
New cards
  1. Decimal 220 in binary (8-bit unsigned)

11011100

23
New cards

17a. Decimal 63789 in hex (16-bit unsigned)

F92D

24
New cards

17b. Decimal 63789 in binary (16-bit unsigned)

1111100100101101

25
New cards
  1. Hex 8235 (16-bit unsigned) in decimal

33333

26
New cards
  1. Hex F1 in decimal

Not enough information

27
New cards
  1. Hex FFFF (16-bit signed) in decimal

-1

28
New cards
  1. Hex FF01 (16-bit signed) in decimal

-255

29
New cards

22a. 16-bit two's complement: -1

FFFF

30
New cards

22b. 16-bit two's complement: most negative

8000

31
New cards

22c. 16-bit two's complement: largest positive

7FFF

32
New cards

22d. 16-bit two's complement: 0

0000

33
New cards
  1. Implementing C = A - B in assembly (A and B >= 0)

The answer is always correct as long as A > B; the answer is always correct for signed numbers

34
New cards
  1. One value in an equation is negative, or the result is negative

You must be using signed numbers

35
New cards
  1. T/F: For the square wave, it does not matter which library is called for the GPIO

False

36
New cards
  1. 30 registers exist in ARMv8, you access 15. Which are available and not reserved?

R0-R12

37
New cards
  1. T/F: In ARM8 RISC, data memory can only go to and from registers

True

38
New cards

28a. General purpose register example

R2

39
New cards

28b. Stack pointer

R13

40
New cards

28c. Link register

R14

41
New cards

28d. Program counter

R15

42
New cards
  1. In the R-format instruction, how many registers are addressable by the Rd field?

32

43
New cards
  1. ARM8 immediate-format data can be…

16 bits or less

44
New cards
  1. An instruction that lets the compiler make cumbersome operations easier

Pseudo instruction

45
New cards

32a. Directive: assign a constant value to a name

.EQU

46
New cards

32b. Directive: assign a name to a register

.REQ

47
New cards

32c. Directive: define a value as 8 bits

.byte

48
New cards

32d. Directive: define a value as 2 bytes

.half

49
New cards

32e. Directive: reserve a byte in memory

.space

50
New cards

32f. Directive: pull an external file into the current file before assembly

.include

51
New cards

32g. Directive: defines the instruction area

.text

52
New cards

32h. Directive: defines the data area

.data

53
New cards
  1. What register holds the flags?

CPSR

54
New cards
  1. Which instructions change the flags?

ADDS, SUBS, CMP

55
New cards

35a. Flag set if the MSB (sign bit) is set

N flag

56
New cards

35b. Flag set if the result is zero

Z flag

57
New cards

35c. Flag set on addition overflow (carry) and on subtraction if no borrow occurs

C flag

58
New cards

35d. Flag set for signed numbers when a positive looks negative or a negative looks positive

V flag

59
New cards
  1. What does a branch instruction do if taken?

Changes the program counter

60
New cards
  1. Branch instructions (not including BX)… (select all)

Can jump forward or backward; provide jump addresses +/- relative to the PC; are considered short jumps; if conditional, depend on an instruction that affects the flag bits

61
New cards
  1. What does BX R0 do?

Loads the value in R0 into the program counter (note: your copy of the guide also marks "has no effect on the program counter"; confirm the keyed answer)

62
New cards
  1. T/F: We can assume over 80% of all branches are taken

True

63
New cards
  1. Why is it reasonable to estimate all branches take one cycle?

Over 80% of branches are taken; the ARM8 processor has very good branch prediction

64
New cards
  1. Default PC increment for the next instruction (bytes)

4

65
New cards
  1. T/F: In the RP4 everything is memory mapped including I/O

True

66
New cards

43a. Flash memory

"Permanent" program storage; holds value independent of power

67
New cards

43b. SRAM

Cache memory; maintains value while powered without refresh

68
New cards

43c. DRAM

Maintains value and requires refresh; lowest cost per bit

69
New cards
  1. Which byte ordering does ARM8 use by default?

Little endian

70
New cards
  1. What are the ARM8 addressing modes?

Immediate, register indirect, scaled register, register direct

71
New cards
  1. T/F: ARM instructions are always on 4-byte boundaries

True

72
New cards
  1. Flags Z=1, C=0, N=0, V=0 mean

Result is zero

73
New cards
  1. Flags Z=0, C=1, N=0, V=0: possible conditions

An addition results in a carry; an unsigned subtraction or CMP results in no borrow

74
New cards
  1. Signed instruction, flags Z=0, C=0, N=1, V=1

A positive signed number looks negative

75
New cards
  1. Signed instruction, flags Z=0, C=1, N=0, V=1

A signed negative number looks positive

76
New cards
  1. mov r0,#0 / mov r6,#1 / L1: add r0,r0,r6 / add r6,r6,#1 / subs r7,r6,#5 / bcc L1. When does the branch occur?

When r6 < 5

77
New cards

52a. .equ data1, 0xFEDCBA98: result of ldr r3, data1

Error in the instruction

78
New cards

52b. .equ data1, 0xFEDCBA98: result of ldr r1, =data1

r1 = 0xFEDCBA98

79
New cards

52c. .equ data1, 0xFEDCBA98: result of mov r5, #data1

Error in the instruction (mov is limited to 8-bit values)

80
New cards

52d. .equ data2, 0xFEDC: result of mov r4, #data2

r4 = 0xFEDC

81
New cards

52e. .equ data1, 0xFEDCBA98: result of ldr r2, =data1

r2 = 0xFEDCBA98

82
New cards