Unit 2 (ORGANIZED Flashcards
Computer system
Computer systems consist of hardware and software components and follow the concept of the input, process, output and storage model.
This means that a computer system takes in some data as input, processes it in a manner that we have requested and outputs the result in some way. During the processing phase, other data, may be needed apart from the inputted. This data will exist in the storage of the computer system and will be used during the processing phase. Furthermore, any new information that may arise from the processing phase may also be saved in the storage.
Data or instructions, storage that are processed
by the central processing unit (CPU).
The cpu
he CPU is a hardware component of a computer system and can perform basic arithmetic, logical or input/output operations, in order to process data from input devices into useful information. The CPU is the ”brain” of a computer system and can process data very quickly but can only process data by following instructions — it cannot think for itself. The CPU can also be referred to as the processor or chip. A block diagram can be created to represent the elements that compromise it.
Main components of CPU and what do they do
MAR, (memory address reigster)
MDR( Memory data register)
CU (control unit)
ALU (arhtimitc logic unit)
The control unit (CU) is responsible for the operation of the CPU. It retrives instructions from the primary memory as well as the sequence of their execution.
The CU is responsible for providing the ALU with the data that needs to be processed as well as the instructions of how the data should be processed..
The arithmetic logic unit (ALU) performs all the basic arithmetic, logical or input/output operations.
The MAR holds the memory address of the data to be used by the ALU, so that the ALU can fetch the corresponding content from the memory and process it accordingly. The MAR may also hold the memory address of where data that has been processed will need to be stored. In order for the MAR to communicate with the primary memory, a connection is necessary. This connection is accomplished by the Memory (Address) Bus.
The MDR holds the data that is to be used by the ALU and then saved to the RAM. The MDR is closely related to the MAR, since whichever memory address location the MAR is holding, the corresponding data will be loaded onto the MDR for processing by the ALU. After the processing has taken place, the ALU places the result onto the MDR and the data is copied to the memory address location in RAM specified by the MAR. The connection between the RAM and the MDR is accomplished by the Data Bus.
What happens is the CU fethces the instructions from primary memory through its registers (MDR &MAR) then once it retrives it, it decodes it and sends it to the ALU for processing). Once the ALU has the instructions on what to do with the data provided by the CU, it does the operations and stores the result in the primary memory
Question: Describe the function of the data bus found in a PC.
:
It carries data to the MDR and then to the ALU from memory and from ALU to the MDR and then to memory.
The data bus carries data between the processor, the memory unit and the input/output devices
Basic registers in the CU
The basic registers in the CU are the memory address register (MAR) and the memory data register (MDR).
Computer systems are, what is binary digit, byte,
Computer systems are binary systems. That means that all the data and instructions that are stored in a computer system are stored in sequences of binary digits that can take only two possible values, 1 and 0. Thus a binary digit (bit) is the basic unit of information in computer systems and can have only two values: either 1 or 0. Eight bits form a byte.
1 Byte = 8 Bits
One byte can store a single character (ex. the letter A).
Size in binary
Bit
4 bites = 1 nibble
8 bites = 1 Byte
1024 Bytes = 1 Kilobyte
1024 Kilobyte = 1 Megabyte
1024 Megabyte = 1 Gigabyte
1024 Gigbyte = 1 Terabyte
Rom and Ram
The RAM stores the executing program instructions as well as any data that is needed. Instructions and data in the RAM are stored in unique memory locations and every such location has an address as well as content. The content is where the instructions and data reside, whereas the memory location is used by the CU to find, retrieve and access the data in order to send it to the ALU for processing.
Similar to the RAM, the ROM holds instructions and data in unique memory locations. Every such location has an address as well as content. Unlike the RAM however, the ROM is used to store permanent instructions and data that cannot be changed and are used to boot and operate the computer. As such, nothing can be altered in the ROM.
Primary memory
The primary memory is the only storage that is directly accessible by the CPU. At any point in time, the primary memory may hold both data and instructions that are currently running on the computer system. These data and instructions are stored in the primary memory as binary machine code (i.e. a series of Os and 15).
Primary memory consists of two type of memory: RAM and ROM’
RAM is a general—purpose storage area meaning that the data stored can be over— written. This allows data and instructions to be loaded for execution and use whenever they are necessary. However, RAM is volatile, which means that whenever power is lost the contents of its memory are wiped (ex. if an unsaved document with changes is open when the power is lost, all the changes that have been made will be lost
On the other hand, ROM is used to store instructions and data and cannot be over—written. This means that the instructions that are embedded in ROM cannot be changed, even if power is lost, and as such is considered non- volatile memory. ROM is used to store programs and instructions that do not need to be
updated or change
Identify some differences between ROM and RAM found in a PC.
ROM cannot be written to, but RAM can be written to.
ROM holds the (BIOS) Basic Input / Output System, but RAM holds the programs running and the data used.
ROM is much smaller than RAM.
ROM is non-volatile (permanent), but RAM is volatile.
Ram two main types
RAM has two main types:
Dynamic RAM (DRAM) Static RAM(SRAM)
Sram is faster but more expesive than dram and as such DRAM is preferred for the main RAM of a computer system. However, a small amount of SRAM is placed between the main RAM and the processor and it is called cache (Figure 2.3). As such, cache is a smaller and faster RAM (SRAM) that temporarily stores instructions and data so that the processor does not need to access the slower main memory (DRAM).
Cache holds the information from the RAM that is most actively used, and accessed most frequently. The computer system will run faster as the slower main memory will need to be accessed less frequently. When the processor needs to read from the main memory, it first checks if a copy of the data exists in the cache. If so, the processor reads from the cache, instead of reading from main memory. This action speeds up the process. If the data to be read do not exist in the cache, the data are first copied to the cache and then used. When the processor needs to write to the main memory it does so through cache memory.
State some differences between Cache Memory and RAM.
Cache memory is closer to the CPU
Cache memory is much faster than RAM. Cache memory is more expensive than RAM.
Cache memory is separated in L1 and L2.
We are interested in two types of cache memories that reside between the main RAM and the processor. These two types are L1 cache and L2 cache. L1 cache is placed on the microprocessor itself whereas L2 cache is placed between the primary memory and the microprocessor
Machine instuction cycle
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 typically consists of four stages: fetch, decode, executer and store.
The machine instruction cycle describes the order that instructions are fethched, decoded, executed, and stored in a computer.
Computer programs are stored in the primary memory as a series of instructions in machine code. These instructions, as well as any other necessary data, have to be moved from the primary memory and into the CPU in order for the computer program to operate. In order for that to happen, specific steps are followed. The following functions are carried out by the CPU in order to run a computer program:
- Fetch instruction from primary memory to control unit
The CPU is responsible for knowing which instruction it needs to take from the primary memory in order to operate correctly. To do that it sends the appropriate address through the memory (address) bus to the primary memory. The instruction that resides in the specific address is then copied into the data bus and sent to the control unit (CU).
The Cu fetches the instructions and stores them in the MAR and MDR using the data bus and address bus, and those instructions are then sent to the alu for operations
- Decode instruction in control unit
The instruction that has been received by the CU is then decoded. Decoding an instruction allows the CPU to be aware of any additional data that are necessary for the execution of the instruction. Any required data that need to be loaded from the primary memory in order for the instruction to be executable are then fetched. The addresses of these data are placed into the memory (address) bus and the data from these addresses are received by the CPU through the data - Execute instruction
The CPU executes the instruction using the necessary data that have been loaded and calculates a result. Depending on the result, additional data may be needed. These data are fetched from the primary memory for further calculations. As before, the addresses of these data are placed into the memory (address) bus and the data from these addresses are received by the CPU through the data bus. - Store result of execution and check for next instruction
After executing the instruction and computing the result the CPU then stores the result in the primary memory. To do so, it specifies the address where the result will reside in the primary memory, using the memory (address) bus and sends the data through the data bus. The CPU then checks for the next instruction and repeats the steps described above by fetching, decoding, executing and finally storing
Secondary memory
Secondary memory is a slow memory that may be written to (just like the RAM) but is also non-volatile (just like the ROM); that is not directly accesible by the CPU .Secondary memory has a relatively high capacity to hold data compared to the primary memory.
he CPU can only access the volatile primary memory that is relatively fast but moderate in capacity. The primary memory is connected to the non-volatile secondary memory that is relatively slower but has a higher capacity to hold data.
Secondary memory is thus what provides persistent storage to computer systems. This is very important since if secondary memory did not exist a computer system would be unable to store instructions and data persistently. Whenever it shut down all the contents of the only existing primary memory would be lost.
Without the availability of secondary memory only ROM, would be able to store programs and instructions. That would mean that since ROM cannot be over-written, a computer would only be able to perform fixed operations and any user data would have to be re- inputted every time the user wished to use them. This would be acceptable for devices such as simple calculators, but imagine a mobile telephone user, who would have to re-enter the names and telephone numbers every time the mobile telephone was powered on. Such a system would be very hard or impossible to use as the user would have to remember all the telephone numbers or carry an address book everywhere!