Computer Science

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

CPU (Central Processing Unit)

A hardware component of a computer system that performs basic arithmetic, logical input/output operations. Functions in the "processing" phase of a computer system. Retrieves/saves data and information from and to the storage (primary memory). The CPU can retrieve data only from the input or primary memory of the computer system. Contains: CU, ALU, MAR, MDR

Compiler (general)

A translator that executes the translation process only once. It normally translates the whole source program into the object program. The object program is saved and next time a programmer wants to use the object program no recompilation is necessary. Compilers issue error messages for all syntax error found and all errors are communicated to the programmer after the entire program is checked. The compilation ends only when all syntax errors have been corrected. Compilers are much faster than interpreters.

Interpreter (general)

A translator that goes through the process of translation every time the program is run. Interpretation refers to the process of reading each line (instruction) of the source program, analyzing it, translating it into the corresponding line of the object program and executing the line. Syntax errors are communicated to the programmer for every instruction that is interpreted.

Machine Language

Binary (made up of 0s and 1s). The only language that can be understood directly by a computer. Hard to keep write, difficult to debug and maintain. Programmer would have to keep track of memory locations and write from the very beginning all the mathematical functions required by a program.

Differences Between Cache Memory and RAM

Cache is closer to the CPU than RAM Cache is faster and more expensive than RAM Cache is separated into L1 (on microprocessor) and L2 (between microprocessor and primary memory).

Machine Instruction Cycle

Computer programs are stored in the primary memory as a series of instructions in machine code. Cycle in moving instructions/data from primary memory into the CPU. It is the basic operation cycle of a computer, taking place in a definite time period, during which one instruction is fetched from memory and executed. It consists of 4 stages: fetch, decode, execute and store. The following functions are carried out by the CPU in order to run a computer program. 1. Fetch instructions from primary memory to control unit: a. CPU is responsible for knowing which instruction it needs to take from the primary memory to operate correctly. b. It sends the appropriate address through the memory (address) bus to the primary. c. The instruction that resides in this address is copied into the data bus and sent back to the control unit. 2. Decode instructions in the control unit: a. The information that the CU has received is then decoded. b. Allows the CPU to be aware of any additional data that is necessary for the execution of the instruction. c. Any additional required data that needs to be loaded from the primary memory are then fetched. d. Addresses of these data are placed into the memory address bus and the data from these addresses are received by the data bus. 3. Execute instruction a. The CPU executes the instruction using the necessary data that has been loaded and calculates a result. b. Depending on the result, additional data might be needed and these data are fetched form the primary memory for further calculation. c. Addresses of these data are placed into the memory (address) bus and the data from these addresses are received by the data bus. 4. Store result of execution and check for next instruction a. After executing the instruction and computing the result, CPU then stores the result in the primary memory. b. It specifies the address where the result will reside in the primary memory using the memory (address) bus and sends the data via the data bus. c. CPU then checks fro next instruction and repeats the steps described above by fetching, decoding, execute and storing the result.

MDR (Memory Data Register)

Holds the data that is to be used by the ALU and then saved to the RAM. It is closely related to the MAR because whichever memory address location the MAR is holding, the corresponding data is loaded on to the MDR, for processing by the ALU. After it has been processed, the ALU places the result back onto the MDR, and the data is copied to the memory address location in the RAM as specified by the MAR. Connection between RAM and MDR is through the Data Bus.

MAR (Memory Address Register)

Holds the memory address of data to be used by the ALU. The ALU will fetch the corresponding content from the memory and process it accordingly. MAR may also hold memory address of where data that has been processed needs to be stored. The MAR contacts with the primary memory through a connection called the Memory Address Bus.

ALU (Arithmetic Logic Unit)

Performs all the basic arithmetic, logical or input/output operations. The CU is responsible for providing the ALU with the data and instructions.

Primary Memory

RAM (Random Access Memory) and ROM (Read Only Memory). The only storage directly accessible by the CPU. Data and instructions are stored as binary machine code (0s and 1s).

Cache Memory

RAM has two main types - Dynamic RAM (DRAM) - Static RAM (SRAM), faster, more expensive A small amount of SRAM is called "cache". Cache is a smaller and faster RAM. Temporarily stores instructions and data so that the processor does not need to access the slower, main memory: DRAM. Holds the info from RAM that is most actively used/accessed. The computer system runs faster as the main memory needs to be accessed less frequently. Whenever processor needs to read from the main memory, it first checks for a copy of the data in the cache. If there is a copy, the processor reads from the cache instead, speeding up the process. If there is not a copy, the data is copied to the cache, then used. When processor needs to write to the main memory, it is also through the cache memory.

Differences Between RAM and ROM

ROM cannot be written to, RAM can be written to. ROM holds the BIOS (Basic Input Output System) but RAM holds the instructions for the programs running and data used. ROM is smaller than RAM. ROM is non-volatile, RAM is volatile.

Assembly Language

Replacement of binary code for development of instructions and reference to address locations with symbols called mnemonics. Assembler was used to convert assembly language mnemonics to machine code. Each assembly language is specific to each computer. Lack of abstraction, and efficiency, needs to focus on problem solving.

CU (Control Unit)

Responsible for the operation of the CPU. Controls the retrieval of instructions from the primary memory as well as the sequence of their execution.

Secondary Memory

Some instructions or data from he RAM need to be moved in order to make space for new instructions and data. These instructions and data are moved to the secondary memory (secondary/auxiliary storage). Relatively slow memory than can be written to just like the RAM but is non-volatile like the ROM. AKA Persistent Storage​ (any data storage device that retains data after power to that device is shut off, non-volatile storage). Secondary memory has a relatively high capacity to store data compared to primary memory. When the computer starts up, RAM is empty and the instructions and data need to be copied onto the RAM in order for the computer systems to run. In most computer systems, these are copied from the secondary memory. Secondary memory = persistent storage to computer systems. If a secondary memory didn't exist, a computer system would be unable to store instructions and data persistently. Only ROM would be able to store programs and instructions without a secondary memory. Since ROM cannot be over-written, a computer would only be able to perform fixed operations. Any user data would have to be re inputted every time the user wanted to use them. Example: Having a phone and re-entering all the names and telephone numbers every time the phone was powered on. CPU can only access the volatile primary memory (that is fast and moderate in capacity) but the primary memory is connected to the secondary memory (Higher capacity, non-volatile and slower) Virtual memory = the use of secondary memory as if it was primary memory. When the primary memory is full and there are a lot of programs running, the computer will move the background program into the secondary memory. When that program is needed again, it will be copied back into the primary memory (ready to be used by the user) and some other program will be moved into the secondary memory. Transfers are made automatically. Secondary memory is required to hold the info that is not needed all the time or is too large to fit as a whole in primary memory. Examples of Secondary Memory Devices: hard drive, solid state drive, CD, DVD, USB flash drive, SD card

ROM

Stores permanent instructions and data that cannot be changed. Every instructions and data in the RAM are stored in unique memory locations. Each Location: Address (Used by CU to find/access data) + Content (instructions/data) NOTHING CAN BE CHANGED IN THE ROM. Example: Instructions used to boot and operate the computer. Used to store instructions and data. Cannot be overwritten. The instructions in the ROM cannot be changed: it is volatile (even if power is lost, it will still be there). It is used to store programs and instructions that do not need to be updated or changed.

RAM

Stores the executing program instructions and data that is needed. Every instructions and data in the RAM are stored in unique memory locations. Each Location: Address (Used by CU to find/access data) + Content (instructions/data) General-purpose storage area. Data can be overwritten. Data and instructions are loaded for execution and used whenever necessary. RAM is volatile (when power is lost, the contents of its memory are wiped). Example: Unsaved work lost.

Compiler, Byte-Code, JVM

Translates a high-level language program into an equivalent low-level language program. Java is compiled into a standard machine language called byte-code (.class file), language for the Java Virtual Machine. JVM is a hypothetical machine designed to execute byte-code. It is a software interpreter. 1. It interprets byte-code through an interpreter: translating into your machine's language and executing those instructions on your computer one byte code instruction at a time. 2. JVM uses a JIT compiler. Reads byte code in chunks and compiles entire chunks to native machine language as needed. Byte-code allows for optimum portability. Java architecture allows the code to run on any machine to which the JVM interpreter has been installed. All details of making the code function on a specific hardware platform are handled by the JVM.

High Level Language

Uses elements of natural language. Easy to use. Facilitates abstraction by hiding significant areas of computing systems. Makes program development simpler, faster and more understandable.


Ensembles d'études connexes

Biology Chapter 14: DNA the genetic material

View Set

Ecology CHAPTER 14: Parasitism and Infectious Diseases

View Set

Ch. 7 Liability of the Healthcare Institution

View Set

NU272 Week 2 EAQ Evolve Elsevier: HESI Prep Med-Surg Integumentary System

View Set

ncti 2, NCTI jones, ROC II, Course 1, NTCI: Troubleshooting Advanced Services

View Set