Reminder Items Flashcards
What is a program?
A program is a set of instructions written in a programming language that performs a specific task when executed by a computer.
What is data?
Data refers to information processed or stored by a computer. It can be in various forms such as text, numbers, images, etc.
What does it mean to run the program?
Running a program means executing its code instructions one by one.
What computer component executes programs?
The CPU (Central Processing Unit) executes programs.
Where is the running program stored? What else (other than the program code) is stored there?
The running program is stored in RAM (Random Access Memory), along with data, variables, and the operating system.
What do we know about RAM memory?
RAM is random-access, relatively slow compared to the CPU, and volatile (loses data when power is off).
What is memory stall?
A memory stall occurs when the CPU waits for data to be fetched from memory, slowing down processing.
What long-term storage do we have?
Long-term storage includes hard drives, SSDs, and other non-volatile storage devices.
What is an executable file?
An executable file is a binary file that contains compiled code ready to be executed by the CPU.
How do the speeds of CPU, RAM, and hard disk compare?
CPU is the fastest, followed by RAM, and then the hard disk, which is the slowest.
What is a machine cycle?
A machine cycle is the basic operation cycle of a computer during which it fetches, decodes, and executes instructions.
What are the basic steps of the machine cycle?
The basic steps are: Fetch, Decode, Execute.
What does frequency measure? What is the measurement unit of frequency?
Frequency measures how often something occurs per second, measured in Hertz (Hz).
What is CPU clock? What is CPU frequency?
The CPU clock synchronizes operations within the CPU. CPU frequency is the speed at which the CPU operates, measured in Hertz.
What is CPU core? What does it mean “quad-core CPU,” “octa-core CPU”?
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 does memory look like?
Memory looks like a linear array of bytes.
What is a byte? What is a bit? How many bits are in a byte?
A byte is 8 bits. A bit is the smallest unit of data, representing a 0 or 1.
What is a memory address?
A memory address is a unique identifier for a memory location.
What is the memory address of a larger chunk of memory?
It’s the address of the first byte of that memory chunk.
What is the length of a memory address? What does it mean “32-bit address”?
The length is the number of bits in the address. A 32-bit address can reference 2^32 memory locations.
How much memory can we address/use with the given length of a memory address?
With a 32-bit address, we can address up to 4 GB of memory.
How long should memory addresses be to address a given amount of memory?
The length should be log2(memory size in bytes)log2(memory size in bytes). For example, 64-bit addresses for up to 16 exabytes.
Can memory contain nothing at all?
No, memory always contains data, even if it’s just zeros or uninitialized data.
What is the relationship between a C++ variable, RAM, and a memory address?
A C++ variable is stored in RAM at a specific memory address.
What is a C++ pointer?
A pointer is a variable that holds the memory address of another variable.
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?
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.
Hexadecimal numbers. Why do we use them? How to convert from hexadecimal to binary and back quickly?
We use hexadecimal for its compact representation of binary data. Conversion is straightforward as each hex digit represents 4 binary bits.
What is a “word”?
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)
What is PC?
The PC (Program Counter) is a CPU register that holds the address of the next instruction to be executed.
What is the language that the CPU understands?
The CPU understands machine language (binary code).
How can we execute a program written in higher-level languages?
Through a process of compilation or interpretation.
What is a compiler? What are compiler advantages?
A compiler translates high-level code into machine code. Advantages include faster execution and optimization of the final program.
What is an interpreter? What are interpreter advantages?
An interpreter executes high-level code directly. Advantages include ease of debugging and platform independence.