CDA 3100 Fall 2011. Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course.

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 COE 202 Digital Logic Design Dr. Aiman El-Maleh
DATA REPRESENTATION CONVERSION.
CS 61C L02 Number Representation (1)Harvey / Wawrzynek Fall 2003 © UCB 8/27/2003  Brian Harvey ( John Wawrzynek  (Warznek) (
Data Representation Computer Organization &
Data Representation COE 205
Level ISA3: Information Representation
CSC 110 – Intro to Computing Lecture 14: Midterm Review.
1 Binary Arithmetic, Subtraction The rules for binary arithmetic are: = 0, carry = = 1, carry = = 1, carry = = 0, carry =
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
1 Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to bits.
Converting Binary to Octal
CS1800 Summer 2014 Binary Numbers. Decimal Integers  What does a decimal number like "87294" really mean?  More generally.
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Real Numbers and the Decimal Number System
Simple Data Type Representation and conversion of numbers
1 CS/COE0447 Computer Organization & Assembly Language Pre-Chapter 2.
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
Numbering systems.
CS105 INTRODUCTION TO COMPUTER CONCEPTS BINARY VALUES & NUMBER SYSTEMS Instructor: Cuong (Charlie) Pham.
Numeral Systems Subjects: Numeral System Positional systems Decimal
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Numbering Systems CS208.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Comp Sci 251 Intro 1 Computer organization and assembly language Wing Huen.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
Number Representation. 10/12/2015CDA31002 Conversion between Representations Now we can represent a quantity in different number representations How can.
1-1 Lecture 1 Class Overview and Appendix A -- Number Systems.
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,
CDA 3100 Fall Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course.
Number systems, Operations, and Codes
16. Binary Numbers Programming in C++ Computer Science Dept Va Tech August, 1999 © Barnette ND, McQuain WD, Keenan MA 1 Binary Number System Base.
Number Base Conversions
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
Introduction To Number Systems Binary System M. AL-Towaileb1.
CDA 3100 Spring Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course.
CDA 3100 Fall2009. Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Positive Integers Dale Roberts,
Numbers in Computers.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
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.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
Digital logic COMP214  Lecture 2 Dr. Sarah M.Eljack Chapter 1 1.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Lecturer: Santokh Singh
Introduction To Number Systems
Lec 3: Data Representation
Logistics Always read the Calendar at
Number Systems Give qualifications of instructors:
Chapter 3 Data Representation
University of Gujrat Department of Computer Science
Chapter 1 Number Systems & Conversions
CDA 3100 Summer 2011.
Introduction to IT By: Muhammed s. anwar.
CDA 3100 Fall 2015.
Number Representation
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
CDA 3100 Spring 2009.
Overview Digital Systems and Computer Systems
CDA 3100 Summer 2013.
Numbering System TODAY AND TOMORROW 11th Edition
CDA 3100 Spring 2010.
Digital Electronics and Microprocessors
CDA 3100 Fall 2012.
Presentation transcript:

CDA 3100 Fall 2011

Special Thanks Thanks to Dr. Xiuwen Liu for letting me use his class slides and other materials as a base for this course

6/23/2016CDA31003 About Me My name is Zhenghao Zhang – Why I am teaching this course: I worked for two years as an embedded system engineer, writing codes for embedded controllers.

What you will learn to answer (among other things) How does the software instruct the hardware to perform the needed functions What is going on in the processor How a simple processor is designed

6/23/2016CDA31005 Why This Class Important? If you want to create better computers – It introduces necessary concepts, components, and principles for a computer scientist – By understanding the existing systems, you may create better ones If you want to build software with better performance If you want to have a good choice of jobs If you want to be a real computer scientist

6/23/2016CDA31006 Career Potential for a Computer Science Graduate x?id=904&terms=starting+salary

6/23/2016CDA31007 Career Potential for a Computer Science Graduate Source: NACE Fall 2005 Report (

Required Background Based on years of teaching this course, I find that you will suffer if you do not have the required C/C++ programming background. We will need assembly coding, which is more advanced than C/C++. If you do not have a clear understanding at this moment of array and loop, it is recommended that you take this course at a later time, after getting more experience with C/C++ programming.

Array – What Happens? #include int main (void) { int A[5] = {16, 2, 77, 40, 12071}; A[A[1]] += 1; return 0; }

Loop – What Happens? #include int main () { int A[5] = {16, 20, 77, 40, 12071}; int result = 0; int i = 0; while (result < A[i]) { result += A[i]; i++; } return 0; }

6/23/2016CDA Class Communication This class will use class web site to post news, changes, and updates. So please check the class website regularly Please also make sure that you check your s on the account on your University record Blackboard will be used for posting the grades

6/23/2016CDA Required Textbook The required textbook for this class is – “Computer Organization and Design” The hardware/software interface – By David A. Patterson and John L. Hennessy – Fourth Edition

6/23/2016CDA Lecture Notes and Textbook All the materials that you will be tested on will be covered in the lectures – Even though you may need to read the textbook for review and further detail explanations – The lectures will be based on the textbook and handouts distributed in class

6/23/2016CDA Decimal Numbering System We humans naturally use a particular numbering system

6/23/2016CDA Decimal Numbering System For any nonnegative integer, its value is given by – Here d 0 is the least significant digit and d n is the most significant digit

6/23/2016CDA General Numbering System – Base X Besides 10, we can use other bases as well – In base X, – Then, the base X representation of this number is defined as d n d n-1 …d 2 d 1 d 0. – The same number can have many representations on many bases. For 23 based 10, it is 23 ten two 17 sixteen, often written as 0x17. –

6/23/2016CDA Commonly Used Bases – Note that other bases are used as well including 12 and 60 Which one is natural to computers? – Why? BaseCommon NameRepresentationDigits 10Decimal5023 ten or Binary two 0-1 8Octal11637 eight Hexadecimal139F hex or 0x139F0-9, A-F

6/23/2016CDA Meaning of a Number Representation When we specify a number, we need also to specify the base – For example, 10 presents a different quantity in a different base – There are 10 kinds of mathematicians. Those who can think binarily and those who can't

Question How many different numbers that can be represented by 4 bits? Always 16 (2 4 ), because there are this number of different combinations with 4 bits, regardless of the type of the number these 4 bits are representing. Obviously, this also applies to other number of bits. With n bits, we can represent 2 n different numbers. If the number is unsigned integer, it is from 0 to 2 n -1.

6/23/2016CDA Conversion between Representations Now we can represent a quantity in different number representations – How can we convert a decimal number to binary? – How can we then convert a binary number to a decimal one?

6/23/2016CDA Conversion Between Bases From binary to decimal example

Converting from binary to decimal Converting from binary to decimal. This conversion is also based on the formula: d = d n-1 2 n-1 + d n-2 2 n-2 +…+ d d d while remembering that the digits in the binary representation are the coefficients. For example, given two, in decimal, it is = 43.

Conversion Between Bases Converting from decimal to binary: – given a number in decimal, repeatedly divide it by 2, and write down the remainder from right to the left, until the quotient is 0 – Example: 11. QuotientRemainder

Digging a little deeper Why can a binary number be obtained by keeping on dividing by 2, and why should the last remainder be the first bit? Note that – Any integer can be represented by the summation of the powers of 2: d = d n-1 2 n-1 + d n-2 2 n-2 +…+ d d d – For example, 19 = = 1 * * * * * 2 0. – The binary representation is the binary coefficients. So 19 ten in binary is two.

Digging a little deeper In fact, any integer can be represented by the summation of the powers of some base, where the base is either 10, 2 or 16 in this course. For example, 19 = 1 * * How do you get the 1 and 9? You divide 19 by 10 repeatedly until the quotient is 0, same as binary! In fact, the dividing process is just an efficient way to get the coefficients. How do you determine whether the last bit is 0 or 1? You can do it by checking whether the number is even or odd. Once this is determined, you go ahead to determine the next bit, by checking ( d - d )/2 is even or odd, and so on, until you don’t have to check any more (when the number is 0).

Conversion between Base 16 and Base 2 Extremely easy. – From base 2 to base 16: divide the digits in to groups of 4, then apply the table. – From base 16 to base 2: replace every digit by a 4- bit string according to the table. Because 16 is 2 to the power of 4.

Addition in binary 39 ten + 57 ten = ? How to do it in binary?

Addition in Binary First, convert the numbers to binary forms. We are using 8 bits. – 39 ten -> – 57 ten -> Second, add them

Addition in binary The addition is bit by bit. We will run in at most 4 cases, where the leading bit of the result is the carry: = = = =11

Subtraction in Binary 57 ten – 39 ten = ?

Subtraction in Binary

Subtraction in binary Do this digit by digit. No problem if – = 0, – = 1 – 1 – 1 = 0. When encounter 0 - 1, set the result to be 1 first, then borrow 1 from the next more significant bit, just as in decimal. – Borrow means setting the borrowed bit to be 0 and the bits from the bit following the borrowed bit to the bit before the current bit to be 1. – Think about, for example, subtracting 349 from 5003 (both based 10). The last digit is first set to be 4, and you will be basically subtracting 34 from 499 from now on.