SlideShare a Scribd company logo
1 of 18
Download to read offline
Nafis’s Classroom 
Organization of Computer System and Assembly Language Primer 
ahmdnafis@gmail.com Chapter - 1
Overview : Organization of Computer System 
•A computer system consists of system unit, I/O (input and output) devices like keyboard, display screen and disk drives 
•IC (integrated-circuits) chips contain thousands of transistors that are used to construct computer circuits 
•IC circuits are also known as digital circuits 
•Digital circuits/IC circuits have voltage signal levels 
•High voltage = 1 & Low voltage = 0 
•1 and 0 are binary digits or bits 
•A string of 1s and 0s is called a bit string 
•CPU consists of the system board/motherboard that contains memory circuits and microprocessor 
•Motherboard has additional expansion slots for connecting extra circuit boards/add-in boards/add-in cards
TIME FOR SOME BASICS! 
RAM & ROM, Bus, CPU Architecture, Memory operations, I/O Devices, Discussion on Programming Languages, A Glance at Assembly Language
Memory: Address, Contents, Bits 
•Information in our computer are stored in memory and a memory circuit can store 1 bit of data 
•Memory circuits are grouped to store a string of 8 bits of data 
•A string of 8 bits = 1 byte of data/information 
•Each memory byte/memory circuit byte has a distinctive numeric address, like street addresses. 
–Address counting starts from zero/0 
–Data stored inside a memory byte is called Content 01101011 01100010 
01001000 
00001011 
0 
1 
2 
3 Contents Address 
•Number of bits in addresses depends on microprocessor architecture 
•Addresses are fixed 
•Contents can change 
•Memory byte will always have 8 bits of data
Memory: Word, Bit Positioning 
•2 bytes form a Word/Memory Word in a memory 
•Numbering for bit positions starts from right like Arabic writing 
•0-7 forms the low- byte in a word 
15 
13 
12 
11 
10 
9 
8 
7 
6 
5 
4 
3 
2 
1 
0 
7 
6 
5 
4 
3 
2 
1 
0 
Byte bit position Word bit position 8 bytes 2 bytes = Word Low-byte High-byte 
•8-15 forms the high-byte in a word 
2 bytes for a Word
Memory Operations & RAM, ROM 
Memory Operations 
•A processor can perform two types of memory operations on the memory 
•Read/Fetch – The original contents are unchanged and the processor can only copy the data 
•Write/Store – The original contents are replaced by new contents 
RAM 
•Random Access Memory/RAM memory can be read and written 
•RAM cannot retain/store the information after the computer is turned off. 
–RAM stores data temporarily 
–Program instructions are loaded into RAM 
ROM 
•Read Only Memory/ROM memory can be used to only read data only 
•ROM are used to store system programs which are known as firmware 
•Also used for self-testing purpose
Buses 
•Buses are communication lines in between the CPU, Memory and I/O devices which send signals through wires 
•There are 3 types of buses: 
–Address Bus: Addresses of the memory locations/memory byte is placed inside this by the CPU 
–Data Bus: The memory sends back the contents of the address as requested by the CPU through this bus 
–Control Bus: The CPU, for example, places the read operation command on the control bus that will be sent to the memory 
CPU Memory 
I/O Data Bus 
Address Bus 
Control Bus
Overview of CPU 
•CPU = Central Processing Unit 
•CPU is the brain of the computer and executes program stored inside the memory 
•CPU is divided into two main units: 
–EU = Execution Unit 
–BIU = Bus Interface Unit 
•A CPU executes programs in the form of instructions that are essentially bit strings (for instance, Intel 8086 instructions are 1 to 6 bytes long) 
–This instructions are group into Instruction Sets and they are written in Machine Language
AX 
BX 
CX 
DX 
SP 
BP 
SI 
DI 
CS 
DS 
SS 
ES 
IP 
Internal Bus Temporary Registers 
Bus Control Logic ALU 
Flags Execution queue 
General Registers External Bus 
Bus Interface Unit (BIU) 
Execution Unit (EU) 
Intel 8086 Architecture
Execution Unit (EU) 
•Execution Unit executes instructions that is sent by the BIU 
•The parts of the EU are: 
–Arithmetic & Logic Unit (ALU): Performs basic arithmetic operations like (+,-,/,*) and logic operations (OR, NOT,AND) 
–General Registers: Are circuits that are memories for storing data for operations. These memories are called by their names as, for example, AX, but not using their numeric addresses. There are 8 General Registers. 
–Temporary Registers: Are memories that store operands for ALU 
–FLAGS Registers: Are memories used for storing results in bits after a certain calculation is complete 
AX 
BX 
CX 
DX 
SP 
BP 
SI 
DI ALU 
Flags Execution Unit (EU) 
Temporary Registers Internal Bus
Bus Interface Unit (BIU) 
•BIU works as the secretary for the EU 
•BIU and EU works simultaneously 
–While the EU execute instructions, the BIU fetches/reads 6 bytes of data and places them in the Execution queue and this is called Instruction Prefetch 
–When the EU directly needs to communicate with the memory or I/O devices, the BIU suspend its operation 
•BIU assists in the communication between the EU and the memory or I/O devices 
•It transmits address, data and control signals on the external and internal buses 
•Holds 5 registers that store addresses for memory locations 
–IP/Instruction Pointer : Contains the address of the next instruction that will be sent to the EU for execution 
CS 
DS 
SS 
ES 
IP Bus Control Logic Execution queue 
External Bus 
Bus Interface Unit (BIU)
How Instructions Are Executed 
•An instruction goes through the process of fetch-execute cycle inside the CPU 
–Fetch: 
•Fetch the instruction from the memory 
•Decode the received instruction to obtain the operation 
•Fetch/Reread data from memory if required 
–Execute: 
•Perfrom the required operation on the data 
•Store or replace the old data in the memory with the new data if necessary 
•A machine instruction, written in 0s & 1s, have two parts: 
–Opcode: It specifies the type of operation that will be executed 
–Operand: They are given memory addresses of data that will be operated on
Explaining Fetch-Execute Cycle 1 
•This analogy will use the instruction execution in Intel 8086 microprocessor 
–The instruction will be fetched from the memory that resides at the address 0 and ADDED with the data stored in the AX Register by the ALU and then address 0 will be updated with the new data0 
•Fetch : The cycle is initiated by the BIU. The BIU places a read request/command on the control bus and the numeric address of 0, that it requires, on the address bus. It receives the requested data on the data bus. The contents will look something like 00110010 ….. . The BIU receives up to 4 bytes of information but the EU can only handle 2 bytes or a word at a time, hence the next 2 bytes are stored in the IP 
•Decode : A decoding circuit inside the EU determines by decoding the information that an ADD operation must be carried out on the contents from the memory with the data on AX Register
Explaining Instruction Execution 2 
•Fetch/Reread Contents from memory : In the previous fetch operation the CPU requested for operation instruction, i.e, what sort of operation shall the EU execute on the contents with the data on the AX Register. In this fetch operation, this time it receives the actual contents from the memory and the contents are stored in the Temporary Register for execution 
•Perform : The data from the AX Register and the Temporary register are added together in the ALU and the sum is stored inside it. 
•Update memory : The computational results are forwarded to the BIU. The BIU places the address on the address bus, a write request on control bus and the newly calculated data on the data bus.
Timing & Clock Pulses 
•A clock circuit controls the processor by a train of clock pulses 
–The time between two pulses is known as the clock period 
–The number of pulses per second is known as clock rate/clock speed 
–Clock speed is measured in gigahertz (1billion cycles per second) 
•Computer circuits are activated by clock pulses 
–Instruction fetching and execution requires one or more clock periods 
•Ex: A multiplication operation takes more than 70 clock periods in x86 Intel architecture 
–If a clock circuit is made faster, then the processor operates faster 
Voltage 
Time 
1 period
I/O Devices & Ports 
•I/O devices are connected to the computer with the I/O circuits 
–Each I/O circuit contains several registers known as I/O Ports 
•Some of the I/O Ports are used for data and others are used for storing commands 
•I/O Ports have their own addresses called I/O Addresses, which are connected to system buses 
•I/O addresses can only hold contents that are typically input and output instructions 
–Data to be inputted are sent to the I/O Ports by the I/O so that the CPU can fetch them 
–Data is written on the I/O Ports which is transmitted as signals to the I/O devices 
•Serial Ports: Data transfer between the I/O ports and the I/O devices can occur 1 bit at a time. Serial Ports are used by slower devices like keyboard 
•Parallel Ports: Data transfer between the I/O ports and the I/O devices can occur 8/16 bit at a time. Parallel Ports are used by faster devices like disk drives.
Assembly & Machine Language 
Machine Language 
1.10100001 00000000 00000000 
2.00000101 00000100 00000000 
3.10100011 00000000 00000000 
Assembly Language 
1.MOV AX, A 
2.ADD AX, 4 
3.MOV A, AX 
1.Fetch/read contents from address A (assembly language uses symbols to represent memory addresses, hence 0 is A) and place it in register AX 
2.Add 4 to AX 
3.Update the address A with the new contents replacing the old contents 
Compiler: Compilers are programs that translate High-level languages, like C++, Java, Actionscript, to Machine language 
Assembler: Assemblers are programs that translate Assembly language to Machine instructions
Happy Coding & 
Salam

More Related Content

What's hot

Microprocessor application (Introduction)
Microprocessor application (Introduction)Microprocessor application (Introduction)
Microprocessor application (Introduction)Ismail Mukiibi
 
Microprocessor Introduction
Microprocessor IntroductionMicroprocessor Introduction
Microprocessor IntroductionNaveen Dubey
 
Introduction to-microprocessors
Introduction to-microprocessorsIntroduction to-microprocessors
Introduction to-microprocessorsVolodymyr Ushenko
 
Microprocessor Fundamentals
Microprocessor FundamentalsMicroprocessor Fundamentals
Microprocessor FundamentalsDiwaker Pant
 
Microprocessors - 80386DX
Microprocessors - 80386DXMicroprocessors - 80386DX
Microprocessors - 80386DXPriyaDYP
 
Microprocessor note
Microprocessor noteMicroprocessor note
Microprocessor notealokbhatta
 
Chapter 1 microprocessor introduction
Chapter 1 microprocessor introductionChapter 1 microprocessor introduction
Chapter 1 microprocessor introductionShubham Singh
 
8085 micro processor- notes
8085 micro  processor- notes8085 micro  processor- notes
8085 micro processor- notesDr.YNM
 
Evolution of microprocessors
Evolution of microprocessorsEvolution of microprocessors
Evolution of microprocessorsharinder
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systemscmkandemir
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessorsvishi1993
 
80286 microprocessor
80286 microprocessor80286 microprocessor
80286 microprocessorAvin Mathew
 
Microprocessors Assignment
Microprocessors AssignmentMicroprocessors Assignment
Microprocessors AssignmentRAHUL957367
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chipsSrikrishna Thota
 

What's hot (20)

Microprocessor application (Introduction)
Microprocessor application (Introduction)Microprocessor application (Introduction)
Microprocessor application (Introduction)
 
Microprocessor Introduction
Microprocessor IntroductionMicroprocessor Introduction
Microprocessor Introduction
 
Introduction to-microprocessors
Introduction to-microprocessorsIntroduction to-microprocessors
Introduction to-microprocessors
 
Pentium processor
Pentium processorPentium processor
Pentium processor
 
Microprocessor Fundamentals
Microprocessor FundamentalsMicroprocessor Fundamentals
Microprocessor Fundamentals
 
Ieee Intel
Ieee IntelIeee Intel
Ieee Intel
 
Microprocessors - 80386DX
Microprocessors - 80386DXMicroprocessors - 80386DX
Microprocessors - 80386DX
 
microprocessor
microprocessormicroprocessor
microprocessor
 
Microprocessor note
Microprocessor noteMicroprocessor note
Microprocessor note
 
Chapter 1 microprocessor introduction
Chapter 1 microprocessor introductionChapter 1 microprocessor introduction
Chapter 1 microprocessor introduction
 
8085 micro processor- notes
8085 micro  processor- notes8085 micro  processor- notes
8085 micro processor- notes
 
Evolution of microprocessors
Evolution of microprocessorsEvolution of microprocessors
Evolution of microprocessors
 
Advanced micro -processor
Advanced micro -processorAdvanced micro -processor
Advanced micro -processor
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
 
introduction to microprocessors
introduction to microprocessorsintroduction to microprocessors
introduction to microprocessors
 
80286 microprocessor
80286 microprocessor80286 microprocessor
80286 microprocessor
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Microprocessors Assignment
Microprocessors AssignmentMicroprocessors Assignment
Microprocessors Assignment
 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chips
 
Microprocessor ppt
Microprocessor pptMicroprocessor ppt
Microprocessor ppt
 

Viewers also liked

Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programmingWondeson Emeye
 
Pai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadPai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadYogesh Deshpande
 
number system ppt
number system ppt number system ppt
number system ppt Akash dixit
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly languageMir Majid
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly languageAhmed M. Abed
 
Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Shehrevar Davierwala
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1Motaz Saad
 
Data communication and network Chapter -1
Data communication and network Chapter -1Data communication and network Chapter -1
Data communication and network Chapter -1Zafar Ayub
 

Viewers also liked (12)

Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programming
 
Microprocessor 8086
Microprocessor 8086Microprocessor 8086
Microprocessor 8086
 
Pai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadPai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_upload
 
Assembly language 2
Assembly language 2Assembly language 2
Assembly language 2
 
number system ppt
number system ppt number system ppt
number system ppt
 
8086 assembly language
8086 assembly language8086 assembly language
8086 assembly language
 
Part I:Introduction to assembly language
Part I:Introduction to assembly languagePart I:Introduction to assembly language
Part I:Introduction to assembly language
 
Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086Assembly language programming_fundamentals 8086
Assembly language programming_fundamentals 8086
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1
 
Number system
Number systemNumber system
Number system
 
Number System
Number SystemNumber System
Number System
 
Data communication and network Chapter -1
Data communication and network Chapter -1Data communication and network Chapter -1
Data communication and network Chapter -1
 

Similar to Assembly Language and Structures of Microcomputer | Chap-1

Unit 1. introduction
Unit 1. introductionUnit 1. introduction
Unit 1. introductionKiran Bagale
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentalsJLoknathDora
 
BCS 100: Introduction to Computer Science Lesson 3
BCS 100: Introduction to Computer Science Lesson 3BCS 100: Introduction to Computer Science Lesson 3
BCS 100: Introduction to Computer Science Lesson 3Ndubi Amos
 
Computer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and MicrocontrollerComputer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and MicrocontrollerAmrutaMehata
 
Bindura university of science education
Bindura university of science educationBindura university of science education
Bindura university of science educationInnocent Tauzeni
 
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptxsruti009988
 
micro controllers 1.ppt
micro controllers 1.pptmicro controllers 1.ppt
micro controllers 1.pptsiminkhan
 
Intermediate machine architecture
Intermediate machine architectureIntermediate machine architecture
Intermediate machine architectureJohn Cutajar
 
Introduction to Computer System
Introduction to Computer System Introduction to Computer System
Introduction to Computer System sonykhan3
 
Computer Architecture and Organization.pptx
Computer Architecture and Organization.pptxComputer Architecture and Organization.pptx
Computer Architecture and Organization.pptxLearnersCoach
 
01 introduction to microcomputers
01 introduction to microcomputers01 introduction to microcomputers
01 introduction to microcomputersayeshasafdar8
 
BAIT1003 Chapter 2
BAIT1003 Chapter 2BAIT1003 Chapter 2
BAIT1003 Chapter 2limsh
 

Similar to Assembly Language and Structures of Microcomputer | Chap-1 (20)

Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Unit 1. introduction
Unit 1. introductionUnit 1. introduction
Unit 1. introduction
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentals
 
ch1.pptx
ch1.pptxch1.pptx
ch1.pptx
 
Chap 3 CA.pptx
Chap 3 CA.pptxChap 3 CA.pptx
Chap 3 CA.pptx
 
BCS 100: Introduction to Computer Science Lesson 3
BCS 100: Introduction to Computer Science Lesson 3BCS 100: Introduction to Computer Science Lesson 3
BCS 100: Introduction to Computer Science Lesson 3
 
Computer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and MicrocontrollerComputer Organization: Introduction to Microprocessor and Microcontroller
Computer Organization: Introduction to Microprocessor and Microcontroller
 
Bindura university of science education
Bindura university of science educationBindura university of science education
Bindura university of science education
 
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
 
Unit I.pptx
Unit I.pptxUnit I.pptx
Unit I.pptx
 
micro controllers 1.ppt
micro controllers 1.pptmicro controllers 1.ppt
micro controllers 1.ppt
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Lecture#06 inner workings of the cpu
Lecture#06   inner workings of the cpuLecture#06   inner workings of the cpu
Lecture#06 inner workings of the cpu
 
Intermediate machine architecture
Intermediate machine architectureIntermediate machine architecture
Intermediate machine architecture
 
9781111306366 ppt ch3
9781111306366 ppt ch39781111306366 ppt ch3
9781111306366 ppt ch3
 
Computer hardware
Computer hardwareComputer hardware
Computer hardware
 
Introduction to Computer System
Introduction to Computer System Introduction to Computer System
Introduction to Computer System
 
Computer Architecture and Organization.pptx
Computer Architecture and Organization.pptxComputer Architecture and Organization.pptx
Computer Architecture and Organization.pptx
 
01 introduction to microcomputers
01 introduction to microcomputers01 introduction to microcomputers
01 introduction to microcomputers
 
BAIT1003 Chapter 2
BAIT1003 Chapter 2BAIT1003 Chapter 2
BAIT1003 Chapter 2
 

Recently uploaded

Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Assembly Language and Structures of Microcomputer | Chap-1

  • 1. Nafis’s Classroom Organization of Computer System and Assembly Language Primer ahmdnafis@gmail.com Chapter - 1
  • 2. Overview : Organization of Computer System •A computer system consists of system unit, I/O (input and output) devices like keyboard, display screen and disk drives •IC (integrated-circuits) chips contain thousands of transistors that are used to construct computer circuits •IC circuits are also known as digital circuits •Digital circuits/IC circuits have voltage signal levels •High voltage = 1 & Low voltage = 0 •1 and 0 are binary digits or bits •A string of 1s and 0s is called a bit string •CPU consists of the system board/motherboard that contains memory circuits and microprocessor •Motherboard has additional expansion slots for connecting extra circuit boards/add-in boards/add-in cards
  • 3. TIME FOR SOME BASICS! RAM & ROM, Bus, CPU Architecture, Memory operations, I/O Devices, Discussion on Programming Languages, A Glance at Assembly Language
  • 4. Memory: Address, Contents, Bits •Information in our computer are stored in memory and a memory circuit can store 1 bit of data •Memory circuits are grouped to store a string of 8 bits of data •A string of 8 bits = 1 byte of data/information •Each memory byte/memory circuit byte has a distinctive numeric address, like street addresses. –Address counting starts from zero/0 –Data stored inside a memory byte is called Content 01101011 01100010 01001000 00001011 0 1 2 3 Contents Address •Number of bits in addresses depends on microprocessor architecture •Addresses are fixed •Contents can change •Memory byte will always have 8 bits of data
  • 5. Memory: Word, Bit Positioning •2 bytes form a Word/Memory Word in a memory •Numbering for bit positions starts from right like Arabic writing •0-7 forms the low- byte in a word 15 13 12 11 10 9 8 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Byte bit position Word bit position 8 bytes 2 bytes = Word Low-byte High-byte •8-15 forms the high-byte in a word 2 bytes for a Word
  • 6. Memory Operations & RAM, ROM Memory Operations •A processor can perform two types of memory operations on the memory •Read/Fetch – The original contents are unchanged and the processor can only copy the data •Write/Store – The original contents are replaced by new contents RAM •Random Access Memory/RAM memory can be read and written •RAM cannot retain/store the information after the computer is turned off. –RAM stores data temporarily –Program instructions are loaded into RAM ROM •Read Only Memory/ROM memory can be used to only read data only •ROM are used to store system programs which are known as firmware •Also used for self-testing purpose
  • 7. Buses •Buses are communication lines in between the CPU, Memory and I/O devices which send signals through wires •There are 3 types of buses: –Address Bus: Addresses of the memory locations/memory byte is placed inside this by the CPU –Data Bus: The memory sends back the contents of the address as requested by the CPU through this bus –Control Bus: The CPU, for example, places the read operation command on the control bus that will be sent to the memory CPU Memory I/O Data Bus Address Bus Control Bus
  • 8. Overview of CPU •CPU = Central Processing Unit •CPU is the brain of the computer and executes program stored inside the memory •CPU is divided into two main units: –EU = Execution Unit –BIU = Bus Interface Unit •A CPU executes programs in the form of instructions that are essentially bit strings (for instance, Intel 8086 instructions are 1 to 6 bytes long) –This instructions are group into Instruction Sets and they are written in Machine Language
  • 9. AX BX CX DX SP BP SI DI CS DS SS ES IP Internal Bus Temporary Registers Bus Control Logic ALU Flags Execution queue General Registers External Bus Bus Interface Unit (BIU) Execution Unit (EU) Intel 8086 Architecture
  • 10. Execution Unit (EU) •Execution Unit executes instructions that is sent by the BIU •The parts of the EU are: –Arithmetic & Logic Unit (ALU): Performs basic arithmetic operations like (+,-,/,*) and logic operations (OR, NOT,AND) –General Registers: Are circuits that are memories for storing data for operations. These memories are called by their names as, for example, AX, but not using their numeric addresses. There are 8 General Registers. –Temporary Registers: Are memories that store operands for ALU –FLAGS Registers: Are memories used for storing results in bits after a certain calculation is complete AX BX CX DX SP BP SI DI ALU Flags Execution Unit (EU) Temporary Registers Internal Bus
  • 11. Bus Interface Unit (BIU) •BIU works as the secretary for the EU •BIU and EU works simultaneously –While the EU execute instructions, the BIU fetches/reads 6 bytes of data and places them in the Execution queue and this is called Instruction Prefetch –When the EU directly needs to communicate with the memory or I/O devices, the BIU suspend its operation •BIU assists in the communication between the EU and the memory or I/O devices •It transmits address, data and control signals on the external and internal buses •Holds 5 registers that store addresses for memory locations –IP/Instruction Pointer : Contains the address of the next instruction that will be sent to the EU for execution CS DS SS ES IP Bus Control Logic Execution queue External Bus Bus Interface Unit (BIU)
  • 12. How Instructions Are Executed •An instruction goes through the process of fetch-execute cycle inside the CPU –Fetch: •Fetch the instruction from the memory •Decode the received instruction to obtain the operation •Fetch/Reread data from memory if required –Execute: •Perfrom the required operation on the data •Store or replace the old data in the memory with the new data if necessary •A machine instruction, written in 0s & 1s, have two parts: –Opcode: It specifies the type of operation that will be executed –Operand: They are given memory addresses of data that will be operated on
  • 13. Explaining Fetch-Execute Cycle 1 •This analogy will use the instruction execution in Intel 8086 microprocessor –The instruction will be fetched from the memory that resides at the address 0 and ADDED with the data stored in the AX Register by the ALU and then address 0 will be updated with the new data0 •Fetch : The cycle is initiated by the BIU. The BIU places a read request/command on the control bus and the numeric address of 0, that it requires, on the address bus. It receives the requested data on the data bus. The contents will look something like 00110010 ….. . The BIU receives up to 4 bytes of information but the EU can only handle 2 bytes or a word at a time, hence the next 2 bytes are stored in the IP •Decode : A decoding circuit inside the EU determines by decoding the information that an ADD operation must be carried out on the contents from the memory with the data on AX Register
  • 14. Explaining Instruction Execution 2 •Fetch/Reread Contents from memory : In the previous fetch operation the CPU requested for operation instruction, i.e, what sort of operation shall the EU execute on the contents with the data on the AX Register. In this fetch operation, this time it receives the actual contents from the memory and the contents are stored in the Temporary Register for execution •Perform : The data from the AX Register and the Temporary register are added together in the ALU and the sum is stored inside it. •Update memory : The computational results are forwarded to the BIU. The BIU places the address on the address bus, a write request on control bus and the newly calculated data on the data bus.
  • 15. Timing & Clock Pulses •A clock circuit controls the processor by a train of clock pulses –The time between two pulses is known as the clock period –The number of pulses per second is known as clock rate/clock speed –Clock speed is measured in gigahertz (1billion cycles per second) •Computer circuits are activated by clock pulses –Instruction fetching and execution requires one or more clock periods •Ex: A multiplication operation takes more than 70 clock periods in x86 Intel architecture –If a clock circuit is made faster, then the processor operates faster Voltage Time 1 period
  • 16. I/O Devices & Ports •I/O devices are connected to the computer with the I/O circuits –Each I/O circuit contains several registers known as I/O Ports •Some of the I/O Ports are used for data and others are used for storing commands •I/O Ports have their own addresses called I/O Addresses, which are connected to system buses •I/O addresses can only hold contents that are typically input and output instructions –Data to be inputted are sent to the I/O Ports by the I/O so that the CPU can fetch them –Data is written on the I/O Ports which is transmitted as signals to the I/O devices •Serial Ports: Data transfer between the I/O ports and the I/O devices can occur 1 bit at a time. Serial Ports are used by slower devices like keyboard •Parallel Ports: Data transfer between the I/O ports and the I/O devices can occur 8/16 bit at a time. Parallel Ports are used by faster devices like disk drives.
  • 17. Assembly & Machine Language Machine Language 1.10100001 00000000 00000000 2.00000101 00000100 00000000 3.10100011 00000000 00000000 Assembly Language 1.MOV AX, A 2.ADD AX, 4 3.MOV A, AX 1.Fetch/read contents from address A (assembly language uses symbols to represent memory addresses, hence 0 is A) and place it in register AX 2.Add 4 to AX 3.Update the address A with the new contents replacing the old contents Compiler: Compilers are programs that translate High-level languages, like C++, Java, Actionscript, to Machine language Assembler: Assemblers are programs that translate Assembly language to Machine instructions
  • 18. Happy Coding & Salam