0% found this document useful (0 votes)
2 views

TOPIC-2_-Inside-the-Microprocessor

This document provides an overview of the internal components and programming model of a microprocessor, detailing key elements such as the Arithmetic Logic Unit (ALU), Control Unit, and various registers. It explains the roles of these components in executing instructions and managing data, including the function of the program counter, status register, and stack pointer. Additionally, it outlines the microprocessor's control logic and internal data bus, emphasizing their importance in the overall operation of the microprocessor system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
2 views

TOPIC-2_-Inside-the-Microprocessor

This document provides an overview of the internal components and programming model of a microprocessor, detailing key elements such as the Arithmetic Logic Unit (ALU), Control Unit, and various registers. It explains the roles of these components in executing instructions and managing data, including the function of the program counter, status register, and stack pointer. Additionally, it outlines the microprocessor's control logic and internal data bus, emphasizing their importance in the overall operation of the microprocessor system.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
Microprocessor and Microcontroller Systems 7 7—eooo EEE TOPIC 2 INSIDE THE MICROPROCESSOR Leaning Objective: At the end of this topic, the student should be able to 1. Identify key components of a microprocessor, such as the control unit, arithmetic logic unit (ALU), registers, and data bus. 2. Demonstrate understanding of microprocessor programming model. Learning Discussions ‘The microprocessor block diagram provides a visual representation of the internal structure and components of a microprocessor. At its core, the diagram typically includes key elements such as the Arithmetic Logic Unit (ALU), Control Unit and Registers. The Control Unit manages the execution of instructions by coordinating the fetch-decode-execute cycle, while the ALU performs arithmetic and logic operations on data. Registers temporarily store data during processing, and the Memory Unit holds both program instructions, Instruction L—, Register K=— 4 8 Control Instruction bit Logic Decoder Internal +—<—— Data Bus K—=> — Figure 1: Microprocessor Block Diagram Microprocessor and Microcontroller Systems 8 a Programming Model The microprocessor programming model as shown in Figure 2 represents the architecture and organization of a microprocessor, providing a conceptual framework for software developers to create applications. It consists of an 8-bit accumulator, one flag register/status register, six 8-bit general purpose register, and two 16-bit special purpose register. Programmers interact with the model through assembly language, a low-level human-readable representation of machine code instructions. The programming model defines the instruction set architecture (ISA), outlining the set of instructions, addressing modes, and data formats that a microprocessor understands. 7 0 ° ‘Accumulator A Status Reg Reg B Reg RegD Reg E Regi Reg ‘SP PC 1s ° Figure 2: Programming Model Three Major Logic Functions of the Microprocessor: 4. ALU 2. Registers 3. Control Logic The ALU or Arithmetic Logic Unit @ Contains the Microprocessor’s data processing logic. @ Contains two input ports and one output port, An input port is made up of the logic circuits used to get a data word into a logic device. An output port Microprocessor and Microcontroller Systems —_—_—_—————e 's made up of the logic circuits used to get a data word out of a logic device, /@ Used to arithmetically or logically change or test data. ® Both input ports are buffered by a temporary register, each port has a register that temporarily stores one data word holding the word for the ALU. The Microprocessor's Registers @ Let's you temporarily store a word or a data @ Some registers serve a special purpose, that is they hold data used in a Specific job. Others are a general-purpose register. All Microprocessors have the following basic registers. Accumulator Program Counter Status Register Stack Pointer General Purpose Register Memory Address Reg. & Logic Instruction Register Temporary Register SPNOBR ONS Accumulator 7+ Microprocessor’s major register to hold data for manipulation. 7 Accumulator’s content is usually one half of an arithmetic or logic ‘operation. 7 The accumulator’s length is the same as that of the microprocessor’s data word. 7 Some of the microprocessors have an accumulator, which is twice as long as their data word and have two accumulators that let you do accumulator- to-accumulator arithmetic and logic operations. Dee EES TTT an ~ Mic , icroprocessor and Microcontroller Systems 10 The Program Counter (PC) & Kee} it seeps (rack of what instruction is being used and what the next instructions will be. at he program counters length must be long enough to address any memory location The pc must be loaded up with a number. This number is the address of the memory location containing the first program instruction. ‘a. When a microprocessor first starts up, it always gets its first instruction from the same memory location. b. Each program instruction step is then executed in sequence unless a special instruction changes the sequence. . The program counter points to a memory location. The control logic fetches an instruction from the memory location. d. Once the instruction is fetched, the microprocessor increments the pc and executes an instruction. e. The incremented program counter now points to the next program instruction. f. The memory address register points to each memory location that the microprocessor wants to use when it wants to use it. g. The memory address register drives the microprocessor’s address bus. h. The memory address register is long enough to address every memory location in the microprocessor's main memory. The Status Register 7 Used to store the results of certain tests performed during the execution of a program. /@ Sometimes itis called a flag register. 7 Often the data in the status register is used to control how the rest of the program will execute __—20A8XwOa eae Microprocessor and Microcontroller Systems in Some of the Common Status Register Bits are: 1. Carry/Borrow ‘® This bit indicates that the last operation caused either a cary or a borrow. The carry bit is set when two binary numbers are added and generate a carry from the eight bits. A borrow is generated when a larger number is subtracted from a smaller number. 2. Zero % The zero bit is set when the operation causes all of the register's bit to be logic zero. This happens not only when you decrement the register, but also when any operation causes the register’s bit all to become logic zero. 3. Negative @ The status register’s negative bit is set when a rei bit is logic 1. In 2's complement arithmetic, a logic 1 in the register’s most significant bit means that the number in the register is negative. fer’s most significant 4, Intermediate Carry / The status register's intermediate carry bit is set when an addition in the first four bits caused a cary into the fifth bit. This is often referred to as the half carry. It is frequently used to assist in the conversion of BCD numbers into binary numbers. 8. Interrupt Flag 7 The status register’s interrupt flag is set when the programmer desires to enable the interrupt functions. It is cleared when the programmer wants to disable the interrupt function. If the microprocessor has multiple interrupts, there may be multiple interrupt flags. 6. Overflow Is set when both an arithmetic carry and a signed carry occur in 2's complement arithmetic operations. 7. Parity 7 |s set when the results of an operation leave the indicated register with an ‘odd number of 1's. a SPENT, Microprocessor and Microcontroller Systems 12 Parity Overflow Interrupt Flas. Intermediate Cary Negative Zero Bit Example: Add the following 8-bit binary numbers, indicate how the results sets the bits of the status register. a), 00001111 b). 00111011 ©). Wit 4). 00000001 aa 1000101 uu 110 e). 01010100 ). 00000001 g). 00001111 h). 11000000 11001100 oun) 00010000 0000001 ‘The Stack Pointer 7 Points to the memory location where temporary data is stored. 7+ The stack is used to keep information like the return address. ‘fv The programmer pushes (puts) information onto the stack in order and pops (takes) information from the stack in the reverse order. @ Last-in-First-Out (LIFO) operation 7m Each time the stack is used to store data in the stack pointer, it is decremented so that it points to the next available location. General Purpose Registers / Simple storage areas 7 Register pairs, BC, DE &HL / When used as a register pair, the two registers act as a single 16-bit register. TCPENTOON Microprocessor and Microcontroller Systems 13 Memory Address Register and Logic a Points to the memory location the processor wants to use @ Hold a binary number, which is the address of a memory location ® Does not increment. @ Contents of the memory address register depend on the instruction being executed. Instruction Register 7 Holds the instructions the microprocessor is currently executing. a. The instruction register holds the binary word that tells the microprocessor what fo do to carry out the current instruction, b. When the instruction is fetched, a copy is taken from the memory location in the program and placed in the instruction register c. During execution, the instruction decoder and control logic read the word in the instruction register. ‘Temporary Data Register 7 Holds data 7 The need for the temporary registers arises because the ALU has no data storage of its own. 7 Cannot be used by the programmer and is not a part of the programming model, The Microprocessors Control Logic ‘7 Decodes the instruction and tells the other logic devices what to do and in what order to carry out the instruction. 7 The microprocessor’s control logic timing comes from the clock. ‘The Microprocessor’s Internal Data Bus 7 Data path between all the microprocessors logic devices /@ Allthe logic devices are always connected to the bus. 7 Logic devices must wait for a signal from the control logic before they can talk to or listen to the bus. 7 Data on the bus moves from source to destination. TT

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy