Chapter 1: CPU & The Fetch, Decode, Execute Cycle Flashcards
Week 1
List different types of hardware.
Computer hardware has a plethora of varieties to choose from. Listed below are some of the most commonly used hardware devices:
- Central Processing Unit (CPU)
- Graphics Processing Unit (GPU) inside graphics card
- Storage devices such as HDDs and SSDs.
- Input devices such as keyboards and touchscreens.
- Output devices such as displays and printers.
Week 1
List different types of software.
Just like computer hardware, computer software comes in all shapes and sizes; some of them include the following:
- Web Applications.
- Operating Systems.
- Web Browsers.
Week 1
How do computers work?
All computers interpret and execute binary code, also known as machine code. Machine code is very dense, hence it is not easy to interpret by humans.
Week 1
What is assembly code?
Assembly code is a low level programming language that communicates directly with the computer’s hardware.
It is translated into machine code by an assembler. Assembly code is represented using alphanumeric characters, but it is still very dense and not easily deciphered.
Week 1
What is a high level programming language?
High level languages are some of the most common programming languages used today.
These languages are considered “high level” because they follow human lexical conventions very closely.
Some of the most commonly used high level languages are listed below
- Java
- C
- Python
- MatLab
- CSS
Week 1
Describe the memory hierarchy.
The memory hierarchy separates computer storage into a hierarchy based on response time. The lower down the hierarchy one goes, the more expansive the storage media get at the expense of transmission speeds.
The memory hierarchy is as follows:
- CPU registers.
- Cache
- RAM
- Flash storage such as SSDs.
- Magnetic storage such as HDDs.
Week 1
Describe the basic components inside a CPU.
A CPU is comprised of all the following components:
- The Control Unit (CU): The CU is tasked with managing data transfer while synchronizing and instructing all CPU components.
- The Arithmetic & Logic Unit (ALU): The ALU is tasked with performing all processes involving arithmetic during the fetch, decode, execute (FDE) cycle.
- Accumulator: While the accumulator is a part of the ALU, it plays a significant role during the FDE cycle since it stores all the values that are a part of one instruction set.
- Memory Address Register (MAR): The MAR is a CPU register that stores the memory address from which data will be fetched from/written to the CPU registers
- Memory Data Register (MDR): The memory data register is the register in a computer’s CPU that stores the data being transferred to and from the immediate access storage such as DRAM.
- Program Counter (PC): The PC stores the memory address of the instruction that is to be executed by the CPU; it increments directly after transmitting the memory address contained within to the MAR.
- Current Instruction Register (CIR): The part of a CPU’s control unit that holds the instruction currently being executed or decoded.
- Instruction Buffer Register (IBR) : An Instruction Buffer or Instruction Queue is a component in some CPU designs that is used to hold a sequence of instructions fetched from memory. Its primary purpose is to help improve instruction fetch and execution efficiency.
Week 1
Briefly explain the fetch, decode, execute (FDE) cycle.
The FDE cycle is performed using the steps listed below.
- The PC contains the memory address of the next instruction to be executed.
- The PC relays the instruction address to the MAR.
- The MDR fetches the information stored in the memory address indicated by the MAR.
- The information stored in the MDR is then transmitted to the CIR; The CU then decides what to do with the instruction received and subsequently decodes and executes it.
- The ALU is activated when necessary at the request of the CU.
For a more detailed explanation, watch this YouTube video
Week 1
What is a system interrupt?
In layman’s terms, a system interrupt halts whatever process the CPU is carrying out.
The CPU carries out the instruction associated with the system interrupt before carrying out other, low priority, processes.
Week 1
What happens when you press a key on a keyboard?
An action as simple as pressing a key on a keyboard can involve many intricate processes. Some key steps are outlined below.
- A scan code is assigned to the key pressed by the microchip in the keyboard.
- The keyboard’s microchip sends the scan code of the key pressed along with the instruction that a key has been pressed to the keyboard controller situated on the motherboard.
- The keyboard controller sends an interrupt signal to the CPU.
- The CPU acknowledges the interrupt request and processes it, forwarding it to the OS for further handling.
- The operating system (OS) then steps in and sends the processed character to the designated program.
- The software then instructs the OS on what to do with the key press. If the key press displays a character, a character will appear on the screen. If the key press triggers a set of events, those events will then be executed.