Академический Документы
Профессиональный Документы
Культура Документы
By Dr. Ridha Jemal Electrical Engineering Department College of Engineering King Saud University
Email: rdjemal@ksu.edu.sa http://faculty.ksu.edu.sa/djemal/default.aspx
Textbook:
The 80X86 IBM PC and Compatible Computers: Assembly Language, Design, and Interfacing Volumes I & II, Muhammad al-Mazidi, Prentice Hall. Intel Microprocessors 8086/8088, 80186/80188, 80286, 80386, 80486, Pentium, Pentium Pro, and Pentium II Processors: Architecture, Programming, and Interfacing, Barry B. Brey, Prentice Hall
Course Grading Midterm#1 Midterm#2 Tutorial Attendance & Project Final Exam
Dr. Ridha Jemal
Page: 3
Element of Computers
A useful microprocessor-based computer system must have : Central Processing Unit (CPU) : To manipulates data and control I/O devices according to the program stored in memory. Memory: To store programs and data Input/Output Devices: Allow CPU to communicate with external hardware Bus System: Connect everything together Address, Data Control signals
Dr. Ridha Jemal
Page: 4
Element of Computers
Data Bus
I/O Interface
Page: 5
Page: 6
Programming is easier Programs are more portable (hardware independent) Little or no knowledge if machine required Working at Lower Levels:
More control over the machine Possible to write very small, efficient programs
Dr. Ridha Jemal
Page: 7
Examples:
PC... MS-DOS... MS-Word PC... UNIX... EMACS Mac... System7... MS-Word HP 9000/715... UNIX... EMACS
Dr. Ridha Jemal
Page: 8
Translation Programs :
Compiler: translate High-level language (HLL) file to file of Machine
code instruction (HLL is independent of CPU) Ex: C, Fortran, Java.
Program Distribution :
Executable Files
Can't (easily) change: not human-readable Users obtain Applications in this format
Source Code
HLL or Assembly Language: human-readable Can change and re-compile/assemble "portable" source code compiles/runs on different CPU's and OS's (GOOD)
Dr. Ridha Jemal
Integers
Unsigned integers +ve nbrs:0,1,2 Signed integers +ve and ve nbrs: .. -3,-2,-1,0,1,2,3
Real number
Floating point numbers 5.61, -32, -2,6x10-6
Characters
a,b, .,z, A, Z, ?!
Unsigned Numbers:
Represent the number 23 using 8-bit unsigned form 00010111
Find the decimal value of the 8-bit unsigned number: 0 1 1 0 1 0 1 0 (0 1 1 0 1 0 1 0)2 = (116)10
EE353: Chapter 1 : Introduction to Microprocessors and Computers Page: 14
Character Sets
ASCII - American Standard Code for Information Interchange
a.k.a ISO 646-1973 (international) BS 4730: 1974 (British Standard) 7-bit code (128 different characters) Numerals, punctuation and letters American alphabet... ... no symbols for , , etc. Still VERY widely used EBCDIC - Extended Binary-Coded-Decimal Interchange Code Proprietary to IBM 8-bit code Not compatible with ASCII ISO Latin1 - 8-bit code Extension to ASCII (ASCII is compatible) Has characters for European languages Future - include ALL characters from ALL languages (!) Unicode (16 bits) ISO 10646 bits)1 : Introduction to Microprocessors and Computers Page: 15 Dr. Ridha Jemal EE353:(32 Chapter
Binary (Base 2) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Octal (Base 8) 00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17
Prefix
= = = = = = = = = = = = 1012 109 106 103 10-3 10-6 10-9 10-12 tera giga mega kilo milli micro nano pico = = = =
Symbol
T G M k m n p 1024 bytes 1024 kbytes 1024 Mbytes 1024 Gbytes
Negative Numbers
Number line extends in both directions:
Ways to represent numbers less than zero: The sign is represented by a bit placed in the leftmost position of the number. The convention is to make the sign bit 0 for positive 1 for negative.
Signed Magnitude
Use MSB as a flag: 0=+ve, 1=-ve ("sign bit") All other bits hold the magnitude eg. using 4 bits 0110 = 6 1010 = -2
0 1010010 as unsigned number is equal to : 1 1010010 as unsigned number is equal to : 1 1010010 as signed number is equal to :
Dr. Ridha Jemal
Negative Numbers
Ones Complement
Twos Complement
To negate number: Invert all bits and add 1 ; eg. -2 using 8 bits * 0000 0010 inverted is 1111 1101 * Add 1: 1111 1110 (-2) Another way: Start writing down the number from left. Write the number exactly as it appears until the first one. Write down the first one and invert all digits to its left eg. +8 = 00001000 1000 writ number to first one 1111 invert the remaining bits -8 = 11111000
Dr. Ridha Jemal
Fractional Representation
Fixed Point
Floating Point
Represent as: (s) a.m 2e m = mantissa e = exponent s = sign (+ or -) Store as: "Normalise" so a is always 0 (or always 1) Gives much wider range than fixed point Many CPUs support floating-point arithmetic