EE3721 Computer System Principles Academic Year 2012/2013 HD Subject Code – EE3721 Lecturer – Raymond Cheung Office email: 1.

Slides:



Advertisements
Similar presentations
Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
Advertisements

Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
ICS312 Set 2 Representation of Numbers and Characters.
Lecture - 2 Number systems and computer data formats
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Assembly Language for Intel-Based Computers, 4th Edition
Data Representation. CMPE12cGabriel Hugh Elkaim 2 Data Representation Goal: Store numbers, characters, sets, database records in the computer. What we.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
What is an instruction set?
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Simple Data Type Representation and conversion of numbers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Logic and data representation Revision. AND gate A B A B All inputs have to be true ( i.e 1) for the output of the gate to be high, in all other cases.
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Number Systems So far we have studied the following integer number systems in computer Unsigned numbers Sign/magnitude numbers Two’s complement numbers.
ACOE2511 ACOE251/AEEC335 -Assembly Language for the 80X86/Pentium Intel Microprocessors Lecturer: Dr. Konstantinos Tatas.
Binary Arithmetic & Data representation
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
Number Systems Spring Semester 2013Programming and Data Structure1.
ICS312 Set 1 Representation of Numbers and Characters.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
10-Sep Fall 2001: copyright ©T. Pearce, D. Hutchinson, L. Marshall Sept Representing Information in Computers:  numbers: counting numbers,
CPU Internal memory I/O interface circuit System bus
1 Lecture 2  Complement  Floating Point Number  Character Encoding.
CSC 221 Computer Organization and Assembly Language
The Teacher CP4 Binary and all that… CP4 Revision.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
1 Representation of Data within the Computer Oct., 1999(Revised 2001 Oct)
CSNB374: Microprocessor Systems Chapter 1: Introduction to Microprocessor.
Data Representation Conversion 24/04/2017.
Data Representation, Number Systems and Base Conversions
ACOE2511 Assembly Language for the 80X86/Pentium Intel Microprocessors Lecturer: Dr. Konstantinos Tatas.
AEEE2031 Data Representation and Numbering Systems.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
Computer Organization and Assembly Languages 2007/11/10
Monday, January 14 Homework #1 is posted on the website Homework #1 is posted on the website Due before class, Jan. 16 Due before class, Jan. 16.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
DIGITAL SYSTEMS Number systems & Arithmetic Rudolf Tracht and A.J. Han Vinck.
Computer Data Formats Microprocessor Course Electrical Engineering Department University of Indonesia.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
1 CE 454 Computer Architecture Lecture 4 Ahmed Ezzat The Digital Logic, Ch-3.1.
CS2100 Computer Organisation
Programming and Data Structure
Data Representation Binary Numbers Binary Addition
Microprocessor Systems Design I
EPSII 59:006 Spring 2004.
William Stallings Computer Organization and Architecture 7th Edition
CS1010 Programming Methodology
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 6
Computer Architecture CST 250
Presentation transcript:

EE3721 Computer System Principles Academic Year 2012/2013 HD Subject Code – EE3721 Lecturer – Raymond Cheung Office 1

Lab. Schedule Commence in week 3 () A short briefing will be provided before the session Form your own group and with 2 students per group 2

Computer System Engineering Reference Textbook – The Intel Microprocess …, Prentice-hall, Barry Brey. ISBN Intel Microprocessors: Architecture, Programming and Interfacing, Ray & Bhurchandi, McGrawHill, ISBN Pentium Processor System Architecture-2nd Editions, Don Anderson/Tom Shanley-Mindshare, Inc. – Latest edition for the above titles 3

Reference books IBM PC Assembly Language and Programming - Fourth Edition (Peter Abel - Prentice-Hall International Inc.) The 8086 and Microprocessors Hardware, Software and Interfacing (A. Singh, W.A. Triebel, Prentice-Hall) 4

Teaching materials Available in WebCT web site (to be announced when available) 5

Related Topics Computer Architectures of microprocessors (2.5 weeks) Assembly Language programming (3 weeks) Memory system overview (2 weeks) Input/Output mechanism (2 weeks) Other computing supporting facilities: interrupt (1.5 weeks), communication (1.5 weeks) 6

Assessment methods Continuous assessment (40%) – Performance in Lab and online exercises (15%) – Lab report (10%) – Quiz (usually only 1 test or quiz) (usually around week 8 or 9) (15%) Examine (60%) 7

Criteria Reference Assessment Pass (D/D+) – Some understanding of assembly language programming – Some understanding of other topics Grade C/C+ – Able to write simple assembly language programs – Able to demonstrate in-depth understanding of certain topics Grade B/B+ – Able to write assembly language program to achieve specific tasks – Able to demonstrate in-depth understanding for most topics Grade A/A+ – Able to write assembly language program – Able to demonstrate in-depth understanding of all topics – Able to apply knowledge learnt to solve real-life problems 8

Objectives To understand the basic principles (hardware components) of a computer system To learn how to control a computer system using assembly language To learn how to design a simple computer system (eg for the development of an electronic mouse, robot, simple control system for your project) 9

Learning outcomes 1. Given specifications of an application and the instruction set of the microprocessor, design an assembly program to carry out the necessary operations 2. able to appreciate advanced features of the latest microprocessors 3. given a set of conditions, design a simple computer system 4. able to think logically and be able to present results 10

Thing that you can do after this 11

More thing that you can do 12

What is a computer ????? Nowadays, computer comes in different forms!!!!!!!!!!!!!!!!!!! In this subject, we try to learn the generic form of a computer!!!!!!!!!!!!!!!! If you are willing to spend your time, it is possible to build your own computing interface 13

What is a computer? 14

Different forms of computer Can you think of a real-life example that involves the application of a microprocessor or a computer? 15

Computer is a digital system Computer is a combination of digital and analogue systems, but mainly digital So to learn this subject, you also need to understand basic digital system as well as binary number system 16

Number systems (revision) The microprocessor (µP) is a binary device, everything inside the microprocessor is represented by 0 and 1. The most direct number system used inside the microprocessor is the binary system (base 2) with only 0 and 1, for example Each digit in the number represents a value in power of 2, starting from the RHS (Right hand side). The first digit is 2 0, then 2 1, 2 2, etc. Usually, the most RHS bit is also called the LSB (least significant bit) while the most LHS bit is the MSB (most significant bit). So the value = 0x x x x x x x x2 0 = = 85 17

Number system In base 10 – 123 = 1x x x10 0 In subtraction 0-1 = -1 but there is no (-) sign in binary system so the answer is 11. The first “1” is called the borrow bit In addition 1+1 = 10 the first “1” is called the carry bit How about = 10 is there a carry? 18

Number system In addition, we use the term byte to represent an 8- bit data and the term word to represent 16-bit value, for a 32-bit value, it is called double word. If we want to represent a very large number then we need to use many bits and this is not very convenient. Therefore we usually use number systems derived from the binary system and the most commonly used number system are Octal (base 8) and hexademical (base 16) usually we just use the term Hex. 19

Hex number system In octal, only digits from 0 to 7 will be used and in hexadecimal, we use 0 to 9 and A, B, C, D, E, F to represent the values. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15 To convert, from a binary number to a hex, it can be done very easily, starting from the RHS, every 4-bit from the binary number can be converted directly into a hex digit. For example: is equal to 55 H (H == hexadecimal), we have two 4-bit groups 0101 and The value 0101 = 5 so the binary pattern is 55 H (in Hex). Example: = C 7 A B H To convert back ABCD H =

Unsigned and signed numbers If a binary pattern represents both positive as well as negative values then it is regarded as signed, otherwise, it is unsigned (only positive). There are two types of signed notations, using a sign bit (usually the most LHS bit) and 2’s complement. For example using the LHS bit as a sign-bit, (0 is positive; 1 – negative ) = -42 while = 42 21

2’s complement Usually the 2’s complement system is used. To convert a value X to –X using 2’s complement, we first do a 1’s complement of X and then add 1 to the result. The 1’s complement of a binary value is to invert its 0’s and 1’s. Example: X = = 42 first convert X using 1’s complement gives then add 1 to the result, i.e = = -42 (comparing ) 22

Floating point representation As mentioned above, each digit in a binary pattern represents a value in the power of 2. In a floating point format, the digits after the decimal point represent value 2 -1, 2 -2, etc. Example, = 1x x x x2 -4 = = How to represent signed floating point values will be discussed in later stage. 23

Floating-point format Floating-point numbers are represented in the form X = ±F 10 ±E F is called the fraction (or mantissa) and E is the exponent example: Floating-point number is usually represented in two standard (defined by IEEE ) 32-bit (single precision) and 64-bit (double precision). A 80-bit (extended precision) standard is also available. 24

IEEE Floating-point standard For single precision – There are 23 bits for fraction and 8 bits exponent and 1 sign bit For double precision – There are 52 bits fraction, 11 bits exponent and 1 sign bit The bit formation is sign Exp. Fraction 25

Floating-point arithmetic Using the format ±F 2 ±E can implement floating point arithmetic very easily X = a x 2 b Y = c x 2 d X*Y = (a* c)* 2 ( b+d ) X/Y = (a/c )* 2 ( b-d ) How about X+Y and X-Y ?????? 26

Example of floating point Given express the value in binary format using single precision floating-point format – First convert the value into the format 1.XXX*2 y – = x 2 7 – So the exponent is 2 and the fraction is – As all floating-point values always come with the ‘1.’ so the ‘1.’ is not stored and only is saved!!!! – … Biased exponent = =

Characters In addition to values, characters are also represented using binary codes usually in ASCII (American Standard Code for Information Interchange) code. 28

ASCII table A = 41H ; a = 61H so a>A 29

Chinese characters There are several ways of representing Chinese characters in computer – Unicode – Big5 – GB (Simplified Chinese) Your computer will need to have proper font installed in order to display the corresponding characters 30

Chinese characters (Big 5) Big 5 is the character encoding standard most commonly used for traditional Chinese characters. Regions / countries such as Taiwan, Hong Kong are using this encoding standard. GB is for simplified Chinese characters Every Chinese Character is represented by a two byte code. The first byte ranges from 0x81 to 0xFE, while the second byte ranges from 0x40 to 0x7E, 0xA1 to 0xFE. Thus, in a document that contain Chinese characters and regular ASCII characters, the ASCII characters are still represented with a single byte. 31

Big 5 Chinese characters AddressCharacter A640H 共 AF66H 病 A741H 你 AA46H 東 32

Exercises Convert the number -4.5 into a IEEE 32-bit floating-point pattern Convert 9 into a IEEE 32-bit floating point Without using a calculator, determine Without using a calculator, determine – What is (a-B)? 33

Revision exercises What is a Bit, a byte, a word, one K, one M What is Hex, Oct, binary Do you know how to convert a number into different base systems without using a calculator? Binary number notation ( = ???) How many different values can be represented by a 8-bit pattern? Hexadecimal A = ??? How to convert binary to Hex? CF H (Hex) = ??? 34

More exercises How to present negative values in binary number system? How about using binary system to represent a floating number??? What is ASCII? What is BCD? What is a string??? Do you know how to program in C/C++, Fortran, Java, assembly language etc ??? Do you know what is a multiplexer, register, latch? Referring to the block diagram of a memory, do you know what is an address; what is data? 35