Cache Memory and Multitasking Concepts

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

1/49

flashcard set

Earn XP

Description and Tags

A set of flashcards covering key concepts related to cache memory, multitasking, and various technical definitions discussed in the lecture.

Last updated 1:55 PM on 4/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

50 Terms

1
New cards

Why is cache memory needed?

Cache memory is needed because the CPU is faster than main memory, causing delays.

2
New cards

What problem does cache solve?

Cache reduces CPU waiting time for data.

3
New cards

What is cache memory?

Cache memory is a small, fast temporary storage located between the CPU and main memory.

4
New cards

What does cache store?

Cache stores recently used data.

5
New cards

What is temporal locality?

Temporal locality refers to the concept that recently used data will likely be used again.

6
New cards

Example of temporal locality?

An example of temporal locality is the repeated use of a variable like 'sum'.

7
New cards

What is spatial locality?

Spatial locality is the principle that nearby memory addresses are likely to be accessed.

8
New cards

Example of spatial locality?

An example of spatial locality is accessing array[i], array[i+1], array[i+2].

9
New cards

Memory hierarchy (fast to slow)?

The memory hierarchy from fast to slow is: Registers, Cache, RAM, Flash, Storage.

10
New cards

What happens as memory size increases?

As memory size increases, it generally becomes slower.

11
New cards

What is a direct-mapped cache?

A direct-mapped cache is a type of cache where each memory block maps to one specific cache location.

12
New cards

Main advantage of direct-mapped cache?

The main advantage of direct-mapped cache is its very fast lookup.

13
New cards

Main disadvantage of direct-mapped cache?

The main disadvantage of direct-mapped cache is conflict misses.

14
New cards

What is stored in a cache entry?

A cache entry stores a valid bit, tag, and data block.

15
New cards

Cache index formula?

The cache index formula is block number mod number of cache blocks.

16
New cards

What is a conflict miss?

A conflict miss occurs when multiple blocks map to the same cache index.

17
New cards

Address breakdown?

The address breakdown consists of a tag, index, and offset.

18
New cards

What is the offset?

The offset selects a byte inside a block.

19
New cards

What is the index?

The index selects a cache block.

20
New cards

What is the tag?

The tag identifies which memory block is stored in the cache.

21
New cards

How many bits for 4096 bytes of memory?

For 4096 bytes of memory, it requires 12 bits.

22
New cards

Offset bits for 16-byte block?

The offset bits for a 16-byte block are 4 bits.

23
New cards

Number of cache blocks (256B cache, 16B block)?

There are 16 cache blocks if the cache is 256B and the block size is 16B.

24
New cards

Index bits for 16 blocks?

The index bits required for 16 blocks are 4 bits.

25
New cards

Tag bits (12 total, 4 index, 4 offset)?

The tag bits needed are 4 bits.

26
New cards

What is a cache hit?

A cache hit occurs when the valid bit is 1 and the tag matches.

27
New cards

What is a cache miss?

A cache miss occurs when there is an invalid bit or tag mismatch.

28
New cards

What happens on a miss?

On a miss, the data is fetched from memory and the cache entry is replaced.

29
New cards

Types of cache misses?

The types of cache misses are compulsory, conflict, and capacity misses.

30
New cards

Hit rate formula?

The hit rate formula is hits divided by total accesses.

31
New cards

Effect of larger block size?

A larger block size improves spatial locality but can create more conflicts.

32
New cards

Effect of larger cache size?

A larger cache size typically results in a higher hit rate but is more costly.

33
New cards

What is a capacity miss?

A capacity miss occurs when the cache is too small to hold the required data.

34
New cards

Modern CPUs use what type of cache?

Modern CPUs use multi-level caches (L1, L2, L3).

35
New cards

What is a matrix keypad?

A matrix keypad is a grid of buttons organized using rows and columns.

36
New cards

How many keys does a 4 by 4 keypad have?

A 4 by 4 keypad has 16 keys.

37
New cards

Pins needed for 4 by 4 keypad?

A 4 by 4 keypad requires 8 pins.

38
New cards

How is a key detected?

A key is detected when it connects a row to a column upon being pressed.

39
New cards

Why use pull-up resistors?

Pull-up resistors are used to prevent floating inputs and noise.

40
New cards

What does OpenOCD do?

OpenOCD is a tool used to debug and program microcontrollers.

41
New cards

Execution time formula?

The execution time formula is cycles divided by CPU frequency.

42
New cards

Clock period formula?

The clock period formula is 1 divided by frequency.

43
New cards

What is DWT_CYCCNT?

DWT_CYCCNT is a cycle counter for measuring execution time.

44
New cards

How to measure execution time with DWT?

To measure execution time with DWT, read the counter before and after the operation, then subtract.

45
New cards

Why is precise timing important?

Precise timing is important to meet real-time constraints.

46
New cards

HAL vs Register performance?

Register-level performance is faster compared to HAL.

47
New cards

What is multitasking?

Multitasking is the ability to run multiple tasks via scheduling.

48
New cards

Are tasks truly parallel on STM32?

No, tasks are not truly parallel on STM32; it is a single core that switches between tasks.

49
New cards

Task states?

The task states are running, ready, blocked, and suspended.

50
New cards

What is priority inversion?

Priority inversion occurs when a high-priority task is blocked by a lower-priority task.