Reminder Items Flashcards

1
Q

What is a program?

A

A program is a set of instructions written in a programming language that performs a specific task when executed by a computer.

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

What is data?

A

Data refers to information processed or stored by a computer. It can be in various forms such as text, numbers, images, etc.

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

What does it mean to run the program?

A

Running a program means executing its code instructions one by one.

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

What computer component executes programs?

A

The CPU (Central Processing Unit) executes programs.

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

Where is the running program stored? What else (other than the program code) is stored there?

A

The running program is stored in RAM (Random Access Memory), along with data, variables, and the operating system.

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

What do we know about RAM memory?

A

RAM is random-access, relatively slow compared to the CPU, and volatile (loses data when power is off).

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

What is memory stall?

A

A memory stall occurs when the CPU waits for data to be fetched from memory, slowing down processing.

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

What long-term storage do we have?

A

Long-term storage includes hard drives, SSDs, and other non-volatile storage devices.

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

What is an executable file?

A

An executable file is a binary file that contains compiled code ready to be executed by the CPU.

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

How do the speeds of CPU, RAM, and hard disk compare?

A

CPU is the fastest, followed by RAM, and then the hard disk, which is the slowest.

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

What is a machine cycle?

A

A machine cycle is the basic operation cycle of a computer during which it fetches, decodes, and executes instructions.

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

What are the basic steps of the machine cycle?

A

The basic steps are: Fetch, Decode, Execute.

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

What does frequency measure? What is the measurement unit of frequency?

A

Frequency measures how often something occurs per second, measured in Hertz (Hz).

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

What is CPU clock? What is CPU frequency?

A

The CPU clock synchronizes operations within the CPU. CPU frequency is the speed at which the CPU operates, measured in Hertz.

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

What is CPU core? What does it mean “quad-core CPU,” “octa-core CPU”?

A

A CPU core is an individual processing unit within the CPU. A quad-core CPU has four cores, and an octa-core CPU has eight cores.

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

How does memory look like?

A

Memory looks like a linear array of bytes.

17
Q

What is a byte? What is a bit? How many bits are in a byte?

A

A byte is 8 bits. A bit is the smallest unit of data, representing a 0 or 1.

18
Q

What is a memory address?

A

A memory address is a unique identifier for a memory location.

19
Q

What is the memory address of a larger chunk of memory?

A

It’s the address of the first byte of that memory chunk.

20
Q

What is the length of a memory address? What does it mean “32-bit address”?

A

The length is the number of bits in the address. A 32-bit address can reference 2^32 memory locations.

21
Q

How much memory can we address/use with the given length of a memory address?

A

With a 32-bit address, we can address up to 4 GB of memory.

22
Q

How long should memory addresses be to address a given amount of memory?

A

The length should be log⁡2(memory size in bytes)log2​(memory size in bytes). For example, 64-bit addresses for up to 16 exabytes.

23
Q

Can memory contain nothing at all?

A

No, memory always contains data, even if it’s just zeros or uninitialized data.

24
Q

What is the relationship between a C++ variable, RAM, and a memory address?

A

A C++ variable is stored in RAM at a specific memory address.

25
Q

What is a C++ pointer?

A

A pointer is a variable that holds the memory address of another variable.

26
Q

What are the most common sizes of the following C++ data types: char, short, int, long, long long, float, double? Does signed/unsigned affect those sizes?

A

char: 1 byte, short: 2 bytes, int: 4 bytes, long: 4 or 8 bytes, long long: 8 bytes, float: 4 bytes, double: 8 bytes. Signed/unsigned does not affect sizes.

27
Q

Hexadecimal numbers. Why do we use them? How to convert from hexadecimal to binary and back quickly?

A

We use hexadecimal for its compact representation of binary data. Conversion is straightforward as each hex digit represents 4 binary bits.

28
Q

What is a “word”?

A

A word is a fixed-sized unit of data, typically the size the CPU can process in one cycle (commonly 4 or 8 bytes). (I think 8 bytes)

29
Q

What is PC?

A

The PC (Program Counter) is a CPU register that holds the address of the next instruction to be executed.

30
Q

What is the language that the CPU understands?

A

The CPU understands machine language (binary code).

31
Q

How can we execute a program written in higher-level languages?

A

Through a process of compilation or interpretation.

32
Q

What is a compiler? What are compiler advantages?

A

A compiler translates high-level code into machine code. Advantages include faster execution and optimization of the final program.

33
Q

What is an interpreter? What are interpreter advantages?

A

An interpreter executes high-level code directly. Advantages include ease of debugging and platform independence.