CPU and Programming Exam Flashcards

1
Q

When the CPU sends an address to RAM, RAM doesn’t do anything with it until the CPU does what?

A

Turns on the on and off wires

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

If the CPU needs to save data to RAM, it outputs an address and data and then turns on the __ wire.

A

set

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

What are some things 1’s and 0’s can represent?

A

Instructions, numbers, addresses, and letters.

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

What does a LOAD instruction do?

A

It loads a number from RAM into the CPU

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

What does a COMPARE instruction do?

A

It compares two numbers

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

What does a JUMP instruction do?

A

It jumps to another address in RAM

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

What is the CPU bus?

A

A group of wires that connect multiple components together

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

What are the two ALU flags used during a COMPARE instruction?

A

the “A is larger” and “Equal”

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

The CPU uses the __________________ register to store the address of the next instruction.

A

Instruction Address

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

What does RAM stand for?

A

Random Access Memory

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

What type of memory can survive without power?

A

Persistent Memory

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

What two inputs does a And-Or Latch have?

A

Set and Reset

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

Using a matrix actually increases the amount of wire needed. (True or False?)

A

False

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

RAM is like a human’s _________ memory.

A

Short Term

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

What are registers?

A

Small, linear chunks of memory that are useful for storing a single value

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

What is RAM?

A

A type of computer memory that stores a lot of numbers located at different addresses

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

What is a CPU’s job?

A

To execute programs

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

What is the order of the instruction cycle?

A

Fetch phase, Decode phase, Execute phase

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

What does the control unit direct?

A

All of the different parts of the CP

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

What component keeps the CPU ticking along?

A

The clock

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

The CPU is a piece of __________ controlled by ____________.

A

Hardware controlled by software

22
Q

What does the jump instruction do?

A

Causes the program to jump to a new location

23
Q

When is the negative flag set?

A

When the result of an arithmetic operation is negative

24
Q

What is a program that runs forever called?

A

Infinite Loop

25
Q

What instruction tells the computer to stop processing?

A

Halt instruction

26
Q

What was the first truly integrated CPU?

A

Intel 4004

27
Q

What is it called when a CPU guesses wrong and has to discard all its speculative results?

A

Pipeline Flush

28
Q

What is a small piece of RAM directly on the CPU called?

A

Cash

29
Q

The first four bits of an instruction is the ________ while the second set of four bits defines the ______.

A

operation code, location

30
Q

What can computer hardware only handle?

A

raw binary instructions

31
Q

What reads in a program written in an assembly language and converts it to native machine code?

A

Assembler

32
Q

What early computer did Hopper work on?

A

Harvard Mark I

33
Q

What programming language did Hopper design first?

A

Arithmetic Language Version 0 (A-0)

34
Q

What are variables?

A

Abstractions for needed memory locations

35
Q

A sorting algorithm is one of the simplest examples of a program. (True or False?)

A

True

36
Q

What is it called when a team rigorously tests out a piece of software, attempting to create
unforeseen conditions that might trip it up?

A

Quality Assurance

37
Q

Operating Systems are just programs. (True or False?)

A

True

38
Q

When did operating systems start to come into use?

A

1950’s

39
Q

What is a terminal?

A

A keyboard and screen that connects to a big computer, but doesn’t contain any processing power itself.

40
Q

What is an Operating System?

A

Software that supports a computer’s basic functions, such as scheduling tasks, executing applications, and controlling peripherals.

41
Q

List some modern operating systems.

A

Linux, Window, Mac OS

42
Q

You can invent your own file format. (True or False)

A

True

43
Q

What is the most straightforward type of file?

A

Text file

44
Q

What do wave files store?

A

Audio

45
Q

Each sample of sound that your microphone records can be represented as a _______.

A

number

46
Q

What do BMPs store?

A

Images

47
Q

What are the steps to go from the source program to the target program in a compiler?

A
  1. Lexical Analysis
  2. Syntax Analysis
  3. Intermediate Code Generation
  4. Code Optimization
  5. Code Generation
48
Q

Explain the steps of the compiler design process

A
  1. The Lexical Analyzer is also known as a scanner and separates the characters of the source program into groups called tokens.
  2. The Syntax Analyzer is also known as a parser and groups tokens into syntactic structures called expressions.
  3. The Intermediate Code Generator produces the intermediate code.
  4. The Code Optimization phase is optional but can improve the performance and size of the target code. 5. The Code Generator is the last phase and takes outputs from the previous phases to generate the final target code.
49
Q

What are some differences between the compiler and interpreter?

A

Compiler:

  • Quick when a program is executed
  • More preparation time

Interpreter:

  • Easy to fix mistakes
  • Lets user see results
  • Runs slower than a compiler
50
Q

Give a brief overview on:

  • Java
  • C++
  • Assembly Language
  • Python
A

Java: a class-based, object-oriented programming language that is designed to have as few
implementation dependencies as possible.
C++: a general-purpose programming language created by Bjarne Stroustrup. It was designed with a bias toward system programming and embedded, resource-constrained
software and large systems.
Assembly Language: any low-level programming language in
which there is a very strong correspondence between the instructions in the language and the
architecture’s machine code instructions.
Python: An interpreted, high-level and general-purpose programming language.