Reminder Items Flashcards

1
Q

Program

A

A list of Instructions for a computer to execute

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

Data

A

Everything that is not an instr

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

executing program code instruction after instruction)

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

Computer component that executes program?

A

CPU

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

Running Program is stored here, what else is stored there?

A

RAM stores currently running programs and data of a program

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

RAM

A

Random access means- it takes roughly the same amount of time to access a piece of data, no matter where this piece of data is stored physically on the memory device.
Volatile - once power supply is off all the data in RAM memory is erased.
Slow compared to the CPU.

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

Memory Stall

A

an undesirable scenario when CPU pauses and waits for the necessary data to be delivered from RAM memory.

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

Long-Term Storage?

A

Hard Disk- non volatile

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

Executable File

A

An executable file is a file that contains machine code or bytecode that can be directly executed by the computer’s CPU or an interpreter without needing further compilation.

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

How speed of CPU, RAM and hard disk compare to each other?

A

CPU, RAM Hard Disk fastest to slowest

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

Cache Memory

A

special device between CPU and RAM, at acts as a buffer for a slower, larger memory. Between the CPU and RAM
- Speeds up interactions between CPU and RAM.

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

ROM memory

A

READ-Only memory
a type of non-volatile memory that stores permanent data and instructions for a computer to start up and run.

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

Machine Cycle

A

sequence of steps that the CPU takes to execute one single instruction.

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

3 Steps Of Machine Cycle

A

Fetch command: retrieving next instruction from RAM memory and stores it in the program counter

Decoding: CPU decodes the instruction to determine what operation needs to be performed

Execution: CPU executes the instruction

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

What Frequency measures? What is the measurement unit of frequency?

A

(Hz = times/second)
Measures CPU frequency or clock rate. How many cycles per second

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

CPU Clock

A

a device (hardware) that issues synchronization pauses for all other CPU components.
When pause arrives, each component does one unit of WORK.

17
Q

CPU Frequency

A

CPU frequency is clock speed, measures how many cycles CPU can complete in one second.
Cycles/ seconds

18
Q

CPU Core

A

little CPU, each one is an individual processor.
our cores, allowing it to process four tasks (or threads) at the same time. (can boost performance w/ apps that are designed to utilize multiple CPU cores)

19
Q

How does memory look like

A

linear array of bytes

20
Q

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

A

BYTE- 8 bits
Bit - Binary Digit in base 2 (either 0/1) they are components of info

21
Q

Memory Address

A

Specific bytes that refer to a specific place in RAM

22
Q

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

A

Typically expressed in hexadecimal

23
Q

Length of memory address

A

2^n where n= length of memory address

24
Q

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

A

log2 ( N) where n- given amount of memory in bytes

25
Q

Can memory contain nothing

A

NO, when the computer is powered on RAM stores information to prepare it for use.

26
Q

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

A

Variables are a high level construct that allows us to deal with RAM.
After compilation variables disappear from the program and turn into memory addresses that refer to a specific place in RAM.

27
Q

C++ pointer

A

a variable that stores the memory address of another variable

28
Q

C++ data types: char, short, int, long, long long, float, double? Does signed/unsigned affect those sizes (for example, is the size of int, signed int, and unsigned int equal)?

A

char: 1 byte (8 bits)
short: 2 bytes
int: 4 bytes (32 bits)
long: 4 bytes (32 bits)
long long: 8 bytes
float: 4 bytes (32 bits)
double: 8 bytes
Signed or unsigned does not effect size they are EQUAL.

29
Q

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

A

A9
1010 1001

This is because memory is typically organized in byte-addressable units, and each hexadecimal digit represents four bits

30
Q

Word

A

is the amount of data that a computer can deal with in one operation. (usually mean 4 bytes)

31
Q

PC

A

Program Counter- stores the address of the next instruction to be executed

32
Q

language that the CPU understands

A

Machine Language -consists of binary instructions.

33
Q

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

A

High-level programming languages (e.g., C++, Python, Java) are translated into machine language via a compiler or interpreter, allowing the CPU to execute those instructions directly.

34
Q

Compiler

A

translates high level code into machine language through a final executable file. The executable can be ran over and over again.

Advantage - creates faster programs. Translates the entire program into machine code before execution begins. Once the program is compiled, the CPU can execute the machine code directly without any further translation.
Disadvanatge: Platform specific to the type of system arch.
Languages: C++, C, Rust

35
Q

Interpreter

A

An interpreter is a type of program that translates and executes code line-by-line rather than translating the entire program at once like a compiler. It reads a high-level programming language (e.g., Python, Ruby, JavaScript), converts each line into machine code, and executes it immediately.

Advantage: Platform Independence
Disadvantage: Programs generally run slower because translation happens every time the program is executed, rather than just once. Plus its needed every time code Is ran.
Interpreted languages: JS, Python, Java, C#