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

Assembly Lecture 1

This document is a lecture on microprocessors aimed at second-year computer network and internet students, covering the architecture, programming, and interfacing of various Intel microprocessors. It details the main components of a computer system, including hardware and software, types of memory, and data representation. Additionally, it explains storage capacity measurements, signed and unsigned numbers, and floating-point number representation using the IEEE-754 standard.

Uploaded by

hiarhiarkhaork
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Assembly Lecture 1

This document is a lecture on microprocessors aimed at second-year computer network and internet students, covering the architecture, programming, and interfacing of various Intel microprocessors. It details the main components of a computer system, including hardware and software, types of memory, and data representation. Additionally, it explains storage capacity measurements, signed and unsigned numbers, and floating-point number representation using the IEEE-754 standard.

Uploaded by

hiarhiarkhaork
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Microprocessor Lecture 1

Lecture made for second year students / Computer


Network and Internet department
References
 The intel Microprocessor-1
8086,8088,80186,80188,80286,80386,80486
Pentium and Pentium processor .Architecture,
programming and Interfacing by Barry B.Bery
 The 8088/8086 Microprocessor programming-2
interfacing,softwear ,Hardware & Applications by
W.A Triebel & A.Singh
Computer System
RAM, ROM-BIOS ,
Hard Disk

Keyboard Control Unit


Mouse Screen
Microphone ALU Speaker
Scanner Printer
Touchpad Registers Plotter
Digital Camera …..
…… Bus

Block diagram of computer system


The Main Components of a Computer
Basically computer is a device
consisting of three pieces:
• A processor to interpret and
execute programs
• A memory to store both data and
programs
• A mechanism for transferring data
to and from the outside world
Computer system consists of:
 Hardware: is the physical part of computer that
can be touched. Some of these parts are:
Keyboard, mouse, webcam, screen …. etc
 Software: is a set of instructions written in
machine
language that instruct computer to do some
specific tasks.
There are two types of programs:
 Operating system: Windows, Linux .... etc.
 Application program: word processing, web
 browsing, database management… etc.
• Application:
Hardware Part :
 Central Processing Unit (CPU):
 The CPU (Central Processing Unit) is normally an Intel (or
equivalent) and it is one of the most important components
within your computer.
 It determines how fast your computer will run and the CPU
speed is measured by its MHz or GHz speed. Thus, a 2 GHz
Pentium is much faster than say a 1 GHz Pentium CPU.
 It is the CPU which performs all the calculations within the
computer, when running programs such as word-processors,
spreadsheets and databases.
Ex: 3.0 GHz clock means that it does 3 billion cycle
(operation) in one second
The CPU contains following
elements:
 Control Unit: The control unit is responsible for
controlling the sequencing and timing of the other
elements making up the CPU.
 Arithmetic Logic Unit (ALU): The ALU performs
the mathematical calculations using data stored within
the CPU registers.
 Registers: The registers are memory storage areas
within the CPU that hold the data that is worked on
by the ALU.
 BUS: The computer bus transports data between the
memory and registers.
Types of memory
A- Random Access Memory (RAM):
◦ The operating system is loaded to RAM when you
switch on your computer and also where your
applications are copied to RAM when you start an
application, such as word processor or database
program.
◦ When you create data (e.g. letters and pictures),
these are initially created and held in RAM and then
copied to disk when you save the data .
◦ It is also called main memory.
◦ Is used to read and write data.
◦ It is volatile memory (when power off stored data is
immediately lost)
RAMs has 2 type :
 Dynamic RAM(DRAM):each bit stored in one transistor.
 Static RAM(SRAM):each bit stored in flip-flop (6 transistor).
DRAM vs SRAM
DRAM cheaper, less power consumption than SRAM,DRAM is
compact (less ,size)
B- Sequential access memory(SAM):
 is a class of data storage devices that read stored data in
a sequence.
 This is in contrast to random access memory (RAM) where
data can be accessed in any order.
 In Sequential memory read / write depend on data position
in memory map.
 Using of this type of memory is very limited.
C- ROM-BIOS (Read Only Memory - Basic
Input Output System) :
 Is a special chip held on your computer's system (mother)board.
 It contains software which is required to make your computer
work with your operating system.
 For instance, it is responsible for copying your operating system
into RAM when you switch on your computer.
 It is a memory for reading only.
 Non-volatile memory (data stays on it after the power off).
ROMs has 4 type :
1- Mask ROM : programmed only by manufacturer
2- Programmable RAM(PRAM):can be programmed only once
3- Erasable PROM(EPROM):programmed many times where
data can be erased by UV(ultra violate)Ray
4- Electrically EPROM(EE PROM): programmed many times
where data can be erased Electrically.
Cont.…
 Software Part
Soft wear includes operating system which is a certain programed
use to manage the computer and interfacing with peripherals and
usually written in low language
Ex.

1- MS-DOS (Microsoft Disk operating system):Real


mode /Single task operating system
2-Windows : protected mode/multitask operating
system
3- UNIX
4- LINux
 Application Part
1-Ready Applications
2-User Applications
3-Programming Languages which include
A- High level Languages: BASIC, FORTRAN,COBOL
B- LOW level Languages :Assembly language/micro Assembler .
Measurement of storage capacity
 It is important that you understand a little about the
measurements used to define storage capacities:
Bit: Computer are digital. This means they work by processing
ones and zeros. The basic one or zeros is called a bit of
information.
Byte: There are eights bits in a Byte.
KB – Kilobyte: There are approximately a thousand bytes in
a KB (also called a KByte) or 2 ^10 = 1024 Byte
MB - Megabyte: There are approximately a million bytes in a
MB (also called a MByte) or 2^ 20 =1024*1024 Byte
GB - Gigabyte: There are approximately a thousand, million
bytes in a GB ( also called a GByte) or 2^30 Byte
TB - Terabyte: There are approximately a million, million
bytes
in a TB (also called a TByte). Or 2^40 Byte
Bits on Bytes
1 byte = 8 bits
1 kilobyte (K / Kb) = 1,024 bytes
1 megabyte (M / MB) = 1,048,576 bytes
(1024KB)
1 gigabyte (G / GB) = 1,073,741,824 bytes
(1024 MB)
1 terabyte (T / TB) = 1,099,511,627,776 bytes
(1024 GB)
Signed and unsigned numbers
Signed number Unsigned number
 There is a sign(-) the  There is a positive
front of number: sign(+) or no sign in
Ex:-(−22)10 = (𝐸𝐶)𝐻 the front of number:
Ex:- (22)10 = (16)𝐻
1− (00010100)2 =(00010100)2
2- 2’s complement
(11101100)2
Data Types and Representation
Characters are represented by 1 Byte(8-bits)using ASCII
ASCII is acronym for American Standard code for Information
Interchange
Start with 0 end by 127 in decimal
0000 0000 00 H
0111 1111 7F H
A-Z 41 H to 5A H Upper case letter
a-z 61 H to 7A H Lower case letter
0 -9 30 H to 39 H Numbers
Symbols
‘$’ 24 H
‘/’ 54 H
.........
Extended ASCII : usually used for foreign letters & additional special
characters
1000 0000 00 H
1111 1111 FF H
Data Types
The data that found in C-programe either
number, character or word:

Numbers

Real
Integer
floating

Unsigned Signed
3.23
3 -3
‫‪Cont. ….‬‬
‫اقل رقم او عدد صحيح ممكن استخدامه بالبرمجة حجمه ‪8‬بت‬
‫اكثر من ‪90%‬من االرقام الموجودة بالطبيعة و المستخدمة ھي موجبة حتى المعالج یقدر یميز االرقام‬
‫السالبة من الموجبة بجب ان یكون ھناك داللة وھي البت األخير ضمن البات تم حجزه لإلشارة‬

‫‪MSB‬‬ ‫‪LSB‬‬

‫اذا كانت قيمة البت األخير ‪0‬معناھا العدد موجب و اذا كانت قيمة البت األخير ‪1‬معناه العدد سالب‪.‬‬
‫‪Positive Number rang in byte size where MSB is 0‬‬
‫‪0-127 in decimal‬‬
‫‪00 H to 7F H in Hex‬‬
‫‪0000 0000 in Binary‬‬
‫‪0111 1111‬‬
‫‪Negative Number range in byte size where MSB is 1‬‬
‫‪-128 to -1 in decimal‬‬
‫‪80 H to FF H in Hex‬‬
‫‪1000 0000 in Binary‬‬
‫‪1111 1111‬‬
8 bit integer (Byte):
Range for signed integer −27 → 27 − 1 or -128→ +127
Range for unsigned integer 0 → 28 − 1 or 0→ +255 , 0 → FF H
16 bit integer (Word):
Range for signed integer −215 → 215 − 1 or -32768 → +32768
Range for unsigned integer 0 → 216 − 1 or 0→ 65535, 0 → FFFFh
32 bit integer (Double Word):
Range for signed integer −231 → 231 − 1 or
Range for unsigned integer 0 → 232 − 1
Example: Represent +12 as 8 bit and as16 bit
0000 1100 as 8 bit
0000 0000 0000 1100 as 16 bit
-24 =? As 8 bit
Find +24 = 0001 1000, 18 H then find 2’s complement
0001 1000
1110 0111
1+
1110 1000
∴ −24 10 = 11101000 2 = (𝐸8)16
-24 =? As 16 bit (H.W)
Real floating point Numbers
Real number are represented using IEEE-754 IEEE( Institute of Electrical and Electronic
Engineering)
‫ھناك ثالث طرق لتمثیل االرقام الحقیقیة‬

1- Single precision (32 bit representation)


‫بت‬32 ‫حیث اقل حجم للرقم الحقیقي بالحاسبة ھو‬

3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0

Sign Exponent Mantissa for fraction


bit 8 bit (31 bit) is ‘0’ the real number is positive23
If the sign bitif the bit is ‘1’ the real number
else
is negative
‫ اي یجب ان یوضع‬Normalized ‫یجب ان یكون العدد‬IEEE-754 ‫قبل تمثیل اي عدد او رقم حقیقي بصیغة‬
exponent= 127+n ‫مقدر تحریك الفارزة وبعد نجد قیمة‬n ‫حیث تمثل ال‬1.xxxxxx*2𝑛 ‫بصیغة‬
Example: Represent the real floating number 8.25
as binary single precision IEEE-754 system
 Normalized process
(8.25)10 = (1000.01)2 ⟹ 1.00001 ∗ 23
mantissa
So that n=3
 Exponent =127+n=127+3=130 ⟹ (10000010)2
 Representation process :sign bit=0
8.25=(01000001000001000000000000000000)=41040000 H
Example: Represent the real floating number -0.125
as binary single precision IEEE-754 system
Normalized process
(0.125)10 = (0.001)2 ⟹ 1.000 ∗ 2−3
mantissa
So that n=-3
 Exponent =127+n=127+-3=124 ⟹ (01111100)2
 Representation process :sign bit=1
-0.125=101111100 00000000000000000000000=BE000000 H
Example: Represent the real floating number 1.3 as
binary single precision IEEE-754 system
Normalized process
(1.3)10 = (1.0100110011)2 ⟹ 1.0100110011 ∗ 20
mantissa
So that n=0
 Exponent =127+n=127+0= 127 ⟹ (01111111)2
 Representation process :sign bit=1
1.3=001111111 01001100110011001100110=3FA66666 H

H.W :Represent the real floating number ( -1.3) as binary single


precision IEEE-754 system
Data representation in memory
‫العنوان في الذاكره مكون من جزئین‬
1- segment 16-bit
2- offset 16-bit
Segment size =64kB
Offset 0000 to 0fff H
1- Byte integer A=3E H
2- Word integer B=105A H
3- Double Word Integer C=3BF0008 H
4- real single precision D=8.25 d =>41040000 H

You might also like