Comp Sci 251 Intro 1 Computer organization and assembly language Wing Huen.

Slides:



Advertisements
Similar presentations
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Advertisements

DATA REPRESENTATION CONVERSION.
2.2 General Positional-Number-System Conversion
Binary & Decimal numbers = 3* * *10 + 5*1 = 3* * * *10 0 Decimal system: Ten digits: 0,1,2,3,…,9 Example:
Assembly Language and Computer Architecture Using C++ and Java
Assembly Language and Computer Architecture Using C++ and Java
Assembly Language for Intel-Based Computers, 4th Edition
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Computer Systems 1 Fundamentals of Computing
Number Systems and Arithmetic
Binary Numbers.
Converting binary to decimal decimal to binary
Revision Introductory Lesson
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Binary and Hexadecimal Numbers
Number Systems.
1 CS/COE0447 Computer Organization & Assembly Language Pre-Chapter 2.
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
Computer Programming I. Today’s Lecture  Components of a computer  Program  Programming language  Binary representation.
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
CPU Internal memory I/O interface circuit System bus
Integer Representation for People Computer Organization and Assembly Language: Module 3.
CCE-EDUSAT SESSION FOR COMPUTER FUNDAMENTALS Date: Session III Topic: Number Systems Faculty: Anita Kanavalli Department of CSE M S Ramaiah.
6 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Number systems, Operations, and Codes
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
Positional Notation 642 in base 10 positional notation is:
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
1 Computer Science LESSON 1 on Number Bases. 2 Objective In this lesson you’ll learn about different Number Bases, specifically about those used by the.
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
Computer Number System
CSC 3210 Computer Organization and Programming
1 EGR 277 – Digital Logic Syllabus Office Hours No food or drinks in the classrooms Web page (demonstration) Lecture #1 EGR 277 – Digital Logic Reading.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Fall’ 2014 Lesson - 1 Number System & Program Design CSE 101.
Fall’ 2014 Number System CSE Number System How Computers Represent Data Binary Numbers The Binary Number System Bits and Bytes Text Codes Binary.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Number Systems Decimal Can you write 12,045 in expanded form? Base? Allowable digits for each place?
Programmable Logic Controller
Binary & Hex Review.
Binary & Decimal numbers
Assembly Language for x86 Processors 6th Edition
Discrete Mathematics Numbering System.
Assembly Language (CSW 353)
Data Representation Binary Numbers Binary Addition
Why to use the assembly and why we need this course at all?
Number Systems.
Writer:-Rashedul Hasan. Editor:- Jasim Uddin
Location in course textbook
Number System conversions
Chapter 1 Number Systems & Conversions
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 6
Number Systems and Binary Arithmetic
Introduction to IT By: Muhammed s. anwar.
Microprocessor and Assembly Language
Numbering System TODAY AND TOMORROW 11th Edition
Chapter 2: Number Systems
AP Computer Science LESSON 1 on Number Bases.
Number Systems Rayat Shikshan Sanstha’s
Number Systems Rayat Shikshan Sanstha’s
Beyond Base 10: Non-decimal Based Number Systems
Binary & Hex Review.
Presentation transcript:

Comp Sci 251 Intro 1 Computer organization and assembly language Wing Huen

Comp Sci 251 Intro 2 Course goals Instruction set architecture – Binary representation of data and instructions – Processor and memory organization

Comp Sci 251 Intro 3 Course goals High-level language implementation – Variables – Control structures – Functions/methods

Comp Sci 251 Intro 4 Course goals Hardware support of instruction set – Memory hierarchy (cache) – Pipelining

Comp Sci 251 Intro 5 Language hierarchy Machine language – Instructions that processor can directly execute – Represented in binary (0’s and 1’s) – Different for each processor (Pentium, MIPS, PowerPC) – What is: ? Assembly language – Symbolic names for machine instructions – Example: add $12, $12, $13 High-level languages – Machine-independent – X = y + z;

Comp Sci 251 Intro 6 Language translation High-level language Assembly language Machine language compiler assembler

Comp Sci 251 Intro 7 Data representation Text and numbers stored in binary (0,1) “Bit”: Binary digit – a single 0 or 1 “Byte”: string of eight bits fundamental unit of computer memory

Comp Sci 251 Intro 8 Number Systems Normal humans: use decimal (base ten) Computer scientists: use alternatives – Binary (base two) – Hexadecimal (base sixteen)

Comp Sci 251 Intro 9 Number Systems Decimal (base ten; digits 0..9) = 8× × ×10 0 Binary (base two; digits 0..1) = 1× × × × ×2 0

Comp Sci 251 Intro 10 Number Systems Hexadecimal (base sixteen; digits 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f) 4d7a 16 = 4× × × ×16 0 Convert the binary number to Hexadecimal 0x031ac040

Comp Sci 251 Intro 11 Decimal  binary conversion Method #1 Write the number as a sum of powers of 2: 2 0, 2 1, 2 2, 2 3, 2 4, 2 5, 2 6, 2 7, 2 8, 2 9, 2 10, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,... Example: convert to binary 57 = = = = = two

Comp Sci 251 Intro 12 Decimal  binary conversion Method #2 Repeatedly divide by 2 until the quotient is 0 The remainders are the bits First remainder is least significant bit (lsb) Last remainder is most significant bit (msb) Example: convert to binary 57 / 2 = 28 r 1 …

Comp Sci 251 Intro 13 Hexadecimal  binary conversion Hexadecimal digit = shorthand for 4 bits a b c d e f Example: convert 6c4d 16 to binary

Comp Sci 251 Intro 14 Addition algorithm Works for any base Work from right to left Add carry-in and two digits  one- or two-digit result Sum = least significant digit Carry out = most significant digit Examples: f c