Unit 1 Flashcards
What component of a computer does all the computing work?
CPU (Central Porcessing Unit)
What is a program?
A list of unambiguous instructions meant to be followed mechanically by a computer.
What is machine langauge?
The language a computer understands. A program can only be executed if matches the computers language, or is translated first.
What does main memory consist of?
A sequence of locations. Each sequence number is called an address.
What is a location?
A sequence of addresses that is part of the main memory.
What is an address?
A single sequence number in a location. Provides a way of picking out one particular piece of information from among the millions stored in memory
How does the CPU interact with the Main Memory?
It sends the address of information it needs as a signal to the memory; the memory responds by sending back the value contained in the specified location.
What is Fetching?
When the CPU repeatedly reads an instruction from memory.
What is executing?
Carrying out an instruction from memory.
What is the Fetch-and-Execute Cycle?
The process of—fetch an instruction, execute it, fetch another instruction, execute it, and so on forever. This is all the CPU ever does (with 1 exception).
What does a multi-core CPU allow the computer to do?
Allows the CPU to execute several instructions simultaneously.
What does a Memory Cache allow?
Allows the computer to store information separate from the main memory, which are meant to hold data and instructions that the CPU is likely to need soon.
What does a CPU contain (3 answers)?
- ALU (Arithmetic Logic Unit)
- Multiple Registers
- PC
What is a General Purpose Register?
This is part of the CPU and contains a single number. Machine Language often refers to these. They can be added (by the ALU) and have the result be entered into another one of these.
What is the most common Special Purpose Register?
The most common is the PC (Program Counter).
What is the ALU?
A part of the CPU, this is used to add or subtract.
What does the PC do?
The CPU uses this to keep track of where it is in the program it is executing. It simply stores the memory address of the next instruction that the CPU should execute.
What is a transistor?
This is how a computer executes programs. It is all done mechanically. When one turns off, it can trigger others to either turn on or off as well based on how they are wired together or based on the program being executed.
What is machine language made up of?
Binary Numbers
What two digits make up all binary numbers?
0 and 1
What is a bit?
A digit in a binary number. Ex. a single 1 or 0.
What is a byte?
A sequence of 8 bits. This is a single memory location.
What does main memory hold?
Holds machine language programs and data.
How long can the Main Memory hold onto information?
Until the power is turned off.
What is a device driver?
Consists of software that the CPU executes when it has to deal with an external device.
What is a Bus?
A set of wires that carry various sorts of information between the devices connected to those wires.
What is Polling?
The CPU polls connected input devices continually to see whether they have any input data to report. Unfortunately, although polling is very simple, it is also very inefficient. The CPU can waste an awful lot of time just waiting for input.
What are Interrupts?
It is a signal sent by another device to the CPU. The CPU responds to an interrupt signal by putting aside whatever it is doing in order to respond to the interrupt.
What is an Interrupt Handler?
Part of a device driver software. It holds the instructions for the CPU whenever the device sends an interrupt signal. The last thing it tells the CPU is for it to continue what it was previously doing.
What is an asynchronous event?
When an interrupt takes the CPU off it’s regular fetch-and-execute cycle, to do something else before continuing it’s fetch-and-execute cycle again. These happen at unpredictable times (unpredictable for the CPU)
Ex. Pressing a button on a keyboard.
What is timesharing?
When a CPU is multitasking and it is giving fractions of a second to each user at a time. This is a type of mutlitasking only used when multiple users are using a single CPU.
What is a thread?
An individual task that the CPU is working on.
What does a blocked thread mean?
It is waiting for something to happen. Either to retrieve data from the hard drive or for the user to input something. This will allow other threads to run until it receives what is requires.
What is preemptive Multitasking?
A computer needs a special timer device that generates an interrupt at regular intervals, such as 100 times per second. When a timer interrupt occurs, the CPU has a chance to switch from one thread to another, whether the thread that is currently running likes it or not.
What type of multitasking do most modern devices use?
Preemptive Multitasking
What are Event Handlers?
They are called asynchronously when specific events occur. Such “event-driven programming” has a very different feel from the more traditional straight-through, synchronous programming.
What is the operating system?
The software that does all the interrupt handling, handles communication with the user and with hardware devices, and controls which thread is allowed to run
What are high-level programming languages?
Complex languages that must be translated into simple machine language before a CPU can run them. Most programs use these.
What are some examples of high-level programming languages?
Java
Python
C++
What is a Compiler?
Takes a high-level-language program and translates it into an executable machine-language program. It does the entire translation at once.
What is an Interpreter?
It translate high-level programming languages to simple machine language one instruction at a time.
What is an example of an Interpreter, that allows programs meant for one machine language to be run on a different machine language?
An Emulator
What is the Java Virtual Machine (JVM)?
programs written in Java are compiled into A machine language, but it is a machine language for a computer that doesn’t really exist. This is the name of that ‘virtual’ computer.
What is a Java Bytecode?
This is what the machine language for the Java Virtual Machine is called.
What is a major advantage of the JVM?
The machine language is uses can be interpreted by any computer. So it is very versatile.
What does a Just-in-Time Compiler do?
It translates Java bytecode into native machine language. It does this while it is executing the program. This speeds up the process.