CPU Architecture and Components

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

According to the Von Neumann architecture, what is a fundamental component that a computer must have?

  • A central processing unit (CPU). (correct)
  • An analog signal converter.
  • A quantum processor.
  • A distributed processing network.

Which component of the CPU is responsible for performing arithmetic and logical operations?

  • Control Unit (CU)
  • Program Counter (PC)
  • Memory Address Register (MAR)
  • Arithmetic Logic Unit (ALU) (correct)

What is the primary function of the Control Unit (CU) within a CPU?

  • To read instructions from memory and synchronize the computer's elements. (correct)
  • To perform complex mathematical calculations.
  • To store data temporarily for quick access.
  • To directly interface with input/output devices.

Which register in the CPU holds the memory address that is currently being accessed for reading or writing?

<p>Memory Address Register (MAR) (C)</p> Signup and view all the answers

What is the role of the Program Counter (PC) in the CPU?

<p>Storing the address of the next instruction to be executed. (D)</p> Signup and view all the answers

Which register stores the bits that indicate the status of operations, such as carry, negative, overflow, and zero?

<p>Status Register (SR) (B)</p> Signup and view all the answers

In the context of the Status Register, under what condition is the Carry Flag set to 1?

<p>When an operation results in a carry-over bit that cannot be represented. (A)</p> Signup and view all the answers

When does the Overflow Flag in the Status Register get set to 1?

<p>When the sum of two positive numbers results in a negative number. (A)</p> Signup and view all the answers

What best describes the function of buses in computer architecture?

<p>They provide pathways for sending and receiving information to and from the CPU. (D)</p> Signup and view all the answers

Which type of bus is unidirectional and exclusively used for specifying the memory locations that the CPU will access?

<p>Address Bus (A)</p> Signup and view all the answers

What is the key characteristic of the Data Bus that differentiates it from the Address Bus?

<p>It is bidirectional, allowing data to flow in both directions. (B)</p> Signup and view all the answers

Which bus is responsible for carrying signals from the Control Unit to all components of the computer, synchronizing operations?

<p>Control Bus (D)</p> Signup and view all the answers

What is the role of ports in a computer system?

<p>To provide connection points for input/output devices. (D)</p> Signup and view all the answers

Which of the following is a characteristic of the USB (Universal Serial Bus) protocol?

<p>It is an asynchronous data transmission protocol that automatically detects and loads drivers. (D)</p> Signup and view all the answers

What is the primary advantage of HDMI over VGA?

<p>HDMI can transmit both audio and video, supporting higher data rates for modern displays. (B)</p> Signup and view all the answers

In the Fetch-Execute cycle, what is the first action performed during the Fetch stage?

<p>Fetching the instruction from the memory location specified by the Program Counter. (D)</p> Signup and view all the answers

During the Fetch-Execute cycle, after the instruction is fetched and loaded into the CIR, what is the next step?

<p>The instruction is decoded. (A)</p> Signup and view all the answers

What action is performed on the Program Counter (PC) during the Fetch stage of the Fetch-Execute cycle, and why?

<p>It is incremented to point to the next instruction. (C)</p> Signup and view all the answers

In the Execute stage of the Fetch-Execute cycle, what is the primary action performed by the CPU?

<p>Interpreting the instruction and sending control signals to the necessary components to execute it. (A)</p> Signup and view all the answers

In Register Transfer Notation (RTN), what do double brackets [[MAR]] signify?

<p>The data stored at the memory location specified by the address in the MAR register. (D)</p> Signup and view all the answers

What is the purpose of an interrupt in the context of CPU operation?

<p>To signal the CPU to temporarily halt its current operations and attend to a different task. (A)</p> Signup and view all the answers

Which of the following can cause an interrupt?

<p>Hardware errors, software errors, or input/output requests. (D)</p> Signup and view all the answers

What determines the order in which the CPU handles different interrupts?

<p>The priority assigned to each interrupt. (B)</p> Signup and view all the answers

Which language do CPUs understand natively?

<p>Machine Code (D)</p> Signup and view all the answers

What is the role of a compiler in the context of programming languages?

<p>To translate high-level programming code into machine code. (B)</p> Signup and view all the answers

What are the two main components of an assembly language instruction?

<p>Opcodes and Operands (C)</p> Signup and view all the answers

What program translates assembly language into machine code?

<p>Assembler (B)</p> Signup and view all the answers

What is the purpose of a 'two-pass' assembler?

<p>To create a separate program that will be executed later, allowing for more programming flexibility. (A)</p> Signup and view all the answers

Which of the following is NOT a classification of assembly instructions?

<p>Memory Allocation (C)</p> Signup and view all the answers

In the context of assembly language, which is the purpose of the STO <addr> instruction?

<p>Stores the content of the Accumulator into memory address <code>&lt;addr&gt;</code>. (A)</p> Signup and view all the answers

What is the function of the assembly instruction OUT?

<p>To display the character whose ASCII value is stored in the Accumulator. (C)</p> Signup and view all the answers

What action does the JMP <addr> instruction perform in assembly language?

<p>It unconditionally jumps to the instruction located at address <code>&lt;addr&gt;</code>. (C)</p> Signup and view all the answers

What is the purpose of comparison instructions in assembly language?

<p>To be used in conjunction with jump instructions to implement conditional branching. (A)</p> Signup and view all the answers

In assembly language, what is 'addressing' referring to?

<p>The method of specifying where the data to be operated on is located. (C)</p> Signup and view all the answers

If the Index Register (IX) is set to 4, and an instruction LDX 200 is executed, which value will be loaded into the Accumulator, assuming the value at memory location 204 is 17?

<p>17 (C)</p> Signup and view all the answers

What happens to bits that 'fall off' during a logical shift operation?

<p>They are lost and replaced by zeros. (C)</p> Signup and view all the answers

How does an arithmetic shift differ from a logical shift?

<p>Arithmetic shifts preserve the sign of the number. (B)</p> Signup and view all the answers

What happens to the bits that are shifted out on one end of a register during a cyclic shift operation?

<p>They are moved to the other end of the register. (A)</p> Signup and view all the answers

If you want to isolate a particular bit within a register for monitoring purposes, which logical operation is most suitable?

<p>AND (D)</p> Signup and view all the answers

To set a specific bit in a register to 1, regardless of its original value, which logical operation should you use?

<p>OR (B)</p> Signup and view all the answers

Which logical operation can be used to flip a specific bit in a register (from 0 to 1 or from 1 to 0)?

<p>XOR (C)</p> Signup and view all the answers

Flashcards

Von Neumann Architecture

A theoretical model developed by Von Neumann in 1945 that serves as the foundation for modern computer architecture, featuring a CPU, RAM, and I/O devices.

CPU (Central Processing Unit)

The processing unit which executes instructions and performs calculations.

Registers (CPU)

Components within the CPU used for temporarily storing data or instructions.

ALU (Arithmetic Logic Unit)

The ALU performs arithmetic (addition, subtraction) and logical (AND, NOT) operations.

Signup and view all the flashcards

Control Unit (CU)

The CU reads instructions from memory and synchronizes the computer's components.

Signup and view all the flashcards

System Clock

Sends timing signals to synchronize computer operations.

Signup and view all the flashcards

IAS (Immediate Access Store)

Another name for RAM, which stores instructions and data for execution.

Signup and view all the flashcards

Current Instruction Register (CIR)

Holds the instruction currently being executed.

Signup and view all the flashcards

Index Register (IX)

It is Utilized for indexed addressing.

Signup and view all the flashcards

Memory Address Register (MAR)

Holds the memory address being accessed.

Signup and view all the flashcards

Memory Data Register (MDR)

Stores data being read from or written to memory.

Signup and view all the flashcards

Program Counter (PC)

Stores the address of the next instruction to be read.

Signup and view all the flashcards

Status Register (SR)

Stores bits indicating the status of operations.

Signup and view all the flashcards

Carry Flag

Indicates a carry-over in binary addition.

Signup and view all the flashcards

Negative Flag

Indicates that the result of an operation is negative.

Signup and view all the flashcards

Overflow Flag

Indicates overflow resulting from an operation.

Signup and view all the flashcards

Zero Flag

Indicates that the result of an operation is zero.

Signup and view all the flashcards

Buses (in CPU)

Pathways for sending and receiving information to/from the CPU.

Signup and view all the flashcards

Address Bus

Sends memory locations for CPU operations; unidirectional.

Signup and view all the flashcards

Data Bus

Transports data the CPU needs; bidirectional.

Signup and view all the flashcards

Control Bus

Carries signals from the CU to computer components; bidirectional.

Signup and view all the flashcards

Computer Ports

Connect external devices to the computer.

Signup and view all the flashcards

USB (Universal Serial Bus)

A protocol for asynchronous data transmission.

Signup and view all the flashcards

HDMI (High-Definition Multimedia Interface)

A port for transmitting audio and video to displays.

Signup and view all the flashcards

VGA (Video Graphics Array)

An older video port superseded by HDMI.

Signup and view all the flashcards

Fetch-Execute Cycle

Divides instructions into fetch and execute stages.

Signup and view all the flashcards

Fetch Phase

CPU requests instruction, increments PC, decodes instruction.

Signup and view all the flashcards

Execute Phase

The instruction is finally decoded and then executed by sending out signals (via the control bus) to the various components of the computer system.

Signup and view all the flashcards

Register Transfer Notation (RTN)

A notation to describe each step in the Fetch-Execute cycle.

Signup and view all the flashcards

Interrupt

A signal sent to the CPU by a device or software, to request processing.

Signup and view all the flashcards

Machine Code

Languages a CPU understands; simple compared to programming languages.

Signup and view all the flashcards

Assembler

A program that translates assembly code into binary instructions.

Signup and view all the flashcards

Single-Pass Assembler

Loads program directly into memory.

Signup and view all the flashcards

Two-Pass Assembler

Creates a separate executable program for later execution.

Signup and view all the flashcards

LDM #n instruction

Load number 'n' into Accumulator.

Signup and view all the flashcards

LDD Instruction

Load the content at address into the Accumulator.

Signup and view all the flashcards

LDI Instruction

Used when you need the address of a variable.

Signup and view all the flashcards

LDX instruction

Load from the Accumulator to Index Addr.

Signup and view all the flashcards

LDR #n instruction

Move the data into the Index register.

Signup and view all the flashcards

Study Notes

CPU Architecture

  • In 1945, mathematician Von Neumann developed a theoretical framework for the concept of a computer
  • According to Von Neumann, a computer should have:
    • A central processing unit (CPU).
    • A main memory (RAM) to store instructions and data.
    • Input/output devices.

CPU Structure

  • The CPU comprises several registers, the control unit (CU), and the arithmetic logic unit (ALU)
  • Registers facilitate quick access to frequently used data and instructions
  • The CU fetches instructions from memory, decodes them, and coordinates their execution
  • The ALU performs arithmetic and logical operations

CPU Components

  • The Arithmetic Logic Unit (ALU) handles arithmetic (addition, subtraction) and logical operations
  • The Control Unit reads instructions from memory (using the Program Counter) and synchronizes all computer elements
  • The System Clock generates timing signals needed for correct operation by sending signals through the control bus
  • Immediate Access Store (IAS) is another name for RAM and stores data for execution although not a element of the CPU itself

Registers

  • Registers are small, high-speed storage areas within the CPU with specific or general purposes in data storage
  • Current Instruction Register (CIR) stores the instruction being executed
  • Index Register (IX) facilitates indexed addressing
  • Memory Address Register (MAR) holds the memory address to be read from or written to
  • Memory Data/Buffer Register (MDR or MBR) stores data read from the address in MAR or to be written to that address
  • Program Counter (PC) stores the address of the next instruction to be read
  • Status Register (SR) stores bits indicating the operation states

Status Register

  • The status register contains 4 bits, each corresponding to a situation in the ALU:
    • Carry flag: Set to 1 if a binary addition results in a carry bit.
    • Negative flag: Set to 1 if the result is negative.
    • Overflow flag: Set to 1 if there is an overflow where summing positive numbers is a negative number
    • Zero Flag: Set to 1 if the result is 0.

Buses

  • Buses in computing send and receive information to/from the CPU, as well as, transfer data and addresses for CPU operation
  • The three main buses in the Von Neumann architecture are the address bus, the data bus, and the control bus

Bus Types

  • The address bus transfers data regarding particular places in memory for CPU operation, functioning unidirectionally
    • Address bus width (number of bits handled) determines the memory locations accessible
      • A 32-bit bus allows up to 4GB of RAM, while a 64-bit bus allows 16 exabytes (17,179,869,184 GB) of RAM
  • The data bus transfers required data to the CPU bidirectionally
    • The direction of a data entry is transferred thru the data bus not the address bus
  • The control bus is bidirectional and carries signals from the CU to computer components
    • A CPU sends a signal through control bus for each cycle

Ports

  • Input/output devices connect to the computer using ports, with the Control Unit managing their interaction
  • Examples: USB, VGA, HDMI

Ports Explained

  • Universal Serial Bus (USB) is an asynchronous data transmission protocol
    • USB cables have 4 smaller cables: two for current (+ and -) and two for data transmission.
    • Computers recognize USB connections, automatically loading drivers or prompting to download them as needed
  • High-Definition Multimedia Interface (HDMI) transfers audio and video from the computer to a display
    • HDMI was developed because VGA does not transfer the necessary amount of data modern screens require.
    • HDMI can safeguard against piracy using HDCP.
  • Video Graphics Array (VGA) - outdated technology allowing resolutions up to 640 x 480 rapidly replaced by HDMI

Fetch-Execute Cycle

  • Instructions reach the processor and are executed in two parts, first receiving the instruction and the executing it

Fetch-Execute Cycle - Fetch

  • The processor requests the instruction from the address stored in the Program Counter (PC), saves it in the CIR, increments the PC by 1, and decodes stored instruction

Fetch-Execute Cycle - Execute

  • The CPU interprets the instruction and sends control signals to the components needed for execution

Fetch-Execute Cycle - RTN

  • Register Transfer Notation (RTN) describes each step when using registers
    • F-E cycle in RTN:
      • MAR <- [PC] (copy PC contents to MAR)
      • PC <- [PC] + 1 (increment PC by 1)
      • MDR <- [[MAR]] (explained shortly)
      • CIR <- [MDR] (copy MDR contents to CIR)
  • Brackets [] signify reference to the data within the register
    • MDR <- [[MAR]], double brackets are used because MAR stores an address and access entails the data at that address

Interrupts

  • An interrupt is a signal sent from a device/software to the CPU, prompting the CPU to pause to handle an event

Interruptions Explained

  • Interrupts arise from input/output devices (keyboard), hardware errors, and software errors, with assigned priorities and are handles in order of importance
  • After handling the interrupt, the CPU continues executing instructions

Assembly Language

  • The only language understood by CPUs machine code which is simpler than most programming languages
  • Programs written in Python use a compiler to translate the code into machine language readable by CPU
  • Each CPU model has its own set of instructions, for example, saving a value at a specific place in computer memory
  • All instructions have an opcode and operands.

Assembly Stages

  • An assembler program translates opcodes and operands to binary and verifies the instruction order
  • Single-pass assemblers store the program directly in memory
  • Two-pass assemblers generate a separate executable program, providing program flexibility and a loader program

Assembly Instructions

  • Assembly instructions may be: data movement, input/output, arithmetic operations, jumps, or comparisons

Data Movement Instructions

  • Using two registers, Accumulator and IX, with accumulators storing operation data and the IX which is utilized for index numbering

Data Movement Operation Codes

  • LDM #n: Stores the number n in the ACC
  • LDD : Stores the content at the address in the ACC
  • LDI : Stores the content of the address stored in the address in the ACC
  • LDX : Stores the content at the address + IX in the ACC
  • LDR #n: Stores n in IX
  • LDR ACC: Stores the data of ACC in IX
  • STO : Stores the contents of the ACC at the address

Input / Output

  • There are two opcodes:
    • IN: Inputs a value and stores its ASCII in ACC
    • OUT: Displays the character whose ASCII value is stored in ACC

Arithmetic Instructions

  • Results from arithmetic operations are stored in the ACC
    • ADD : Adds contents of with the ACC
    • ADD #n: Adds n to the ACC
    • SUB : Subtracts contents of from the ACC
    • SUB #n: Subtracts n from the ACC
    • INC : Adds 1 to (ACC or IX)
    • DEC : Subtracts 1 from (ACC or IX)

Jump instructions

  • Jump instructions change the PC number to the given address, affecting the next instruction executed
    • JMP : Jumps to address
    • JPE : Jumps if comparison is TRUE.
    • JPN : Jumps if comparison is FALSE.

Comparison Instructions

  • Comparison instructions are used with jumps
    • CMP : Compares the contents of ACC with the location at
    • CMP #n: Compares ACC with n
    • CMI : Compares ACC with the data within the address

Addressing

  • Addressing indicates where to retrieve operational data, related to data movement instructions
  • Addressing types include Absolute, Direct, Indirect, Indexed, Immediate, Relative, and Symbolic

Addressing Types

  • Direct Addressing: LDD 200 stores the number 20 in ACC
  • Indirect Addressing: LDI 200 stores the number 5 in ACC
  • Indexed Addressing (IX=4): LDX 200 stores 17 in ACC
  • Immediate Addressing: LDM #200 stores 200 in the ACC

Manipulation of Bits

  • The binary shift moves bits stored in a register a certain number of places with differing effect

Kinds of Binary Shift

  • Logical Shift: Bits leaving the register are replaced by 0.
  • Arithmetic Shift: The sign of the number is maintained.
  • Cyclic Shift: Bits leaving one side of the register enter from the other.
  • All of these shifts may be move bits to the left of the right

Results of Binary Shift Example

  • For a register with a binary value of 10101111:
    • Logical Shift to the left by 3 places: 01111000.
    • Arithmetic Shift to the right by 3 places: 11110101.
    • Cyclic Shift to the left by 3 places: 01111101.

Assembly Opcodes for Corrimiento de Bits (Bit shifting)

  • LSL n: Logical Shift to the left n places.
  • LSR n: Logical Shift to the right n places.

Bit Monitoring and Control

  • Monitoring and control identify each bit in a register separately, utilizing logical operations
    • AND gate can determine if a bit is 1 or 0.
    • OR gate sets a bit to 1.
    • XOR gate sets a bit to 0.

Assembly Instructions for Bit Monitoring and Control

  • AND n: AND the contents of the ACC and n.
  • AND : AND the contents of the ACC and the contents of .
  • XOR n: XOR between ACC and n.
  • XOR : XOR between the ACC and the content of .
  • OR n: OR between ACC and n.
  • OR : OR between ACC and content of .

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Computer Architecture Basics
22 questions
CS UNIT 4
24 questions

CS UNIT 4

OverjoyedBowenite1626 avatar
OverjoyedBowenite1626
CPU Architecture and Components
33 questions

CPU Architecture and Components

SofterCommonsense3842 avatar
SofterCommonsense3842
Use Quizgecko on...
Browser
Browser