CISC1400: Binary Numbers & Computer Fall 2011, Dr. Zhang 1.

Slides:



Advertisements
Similar presentations
Data Representation COE 202 Digital Logic Design Dr. Aiman El-Maleh
Advertisements

The Binary Numbering Systems
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
Level ISA3: Information Representation
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Introduction to Programming with Java, for Beginners
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Data Representation in Computers
Chapter 02 Binary Values and Number Systems Nell Dale & John Lewis.
Mantıksal Tasarım – BBM231 M. Önder Efe
Dr. Bernard Chen Ph.D. University of Central Arkansas
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
Numeral Systems Subjects: Numeral System Positional systems Decimal
CSC 101 Introduction to Computing Lecture 9 Dr. Iftikhar Azim Niaz 1.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
How Computers Work Dr. John P. Abraham Professor UTPA.
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
Logic and Digital System Design - CS 303
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Transforming Data into Information.
Copyright © 2003 by Prentice Hall Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction.
Foundations of Computer Science Computing …it is all about Data Representation, Storage, Processing, and Communication of Data 10/4/20151CS 112 – Foundations.
Computer Programming I. Today’s Lecture  Components of a computer  Program  Programming language  Binary representation.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
Data Representation.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Compsci Today’s topics l Binary Numbers  Brookshear l Slides from Prof. Marti Hearst of UC Berkeley SIMS l Upcoming  Networks Interactive.
مدار منطقي مظفر بگ محمدي Course Structure & Grading Homework: 25% Midterm: 30% Final:50% There is 5% extra! ( =105!) Textbook:
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,
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
Binary Values and Number Systems Chapter Goals Distinguish among categories of numbers Describe positional notation Convert numbers in other bases.
Positional Notation 642 in base 10 positional notation is:
Data Representation – Chapter 3 Section 3-1. Terminology “Digital” –Discrete, well defined values/steps –Opposite of analog –Analogy: digital is to analog.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Computer Math CPS120: Lecture 3. Binary computers have storage units called binary digits or bits: Low Voltage = 0 High Voltage = 1 all bits have 0 or.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Data Representation, Number Systems and Base Conversions
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
MECH1500 Chapter 3.
Chapter 1: Binary Systems
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
BINARY SYSTEMS ENGR. KASHIF SHAHZAD 1. BINARY NUMBERS 1/2 Internally, information in digital systems is of binary form groups of bits (i.e. binary numbers)
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Unit 1 Introduction Number Systems and Conversion.
3 – Boolean Logic and Logic Gates 4 – Binary Numbers
Invitation to Computer Science, C++ Version, Fourth Edition
Number Systems and Codes
Data Representation.
3.1 Denary, Binary and Hexadecimal Number Systems
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CHAPTER 1 : INTRODUCTION
Fundamentals & Ethics of Information Systems IS 201
University of Gujrat Department of Computer Science
Invitation to Computer Science, Java Version, Third Edition
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Chapter Four Data Representation in Computers By Bezawit E.
CHAPTER 69 NUMBER SYSTEMS AND CODES
Presentation transcript:

CISC1400: Binary Numbers & Computer Fall 2011, Dr. Zhang 1

Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be interpreted differently:  in the binary symbol: three  in the decimal symbol: eleven  “LXXX” represents 80 in Roman numeral system  For every number, there is a unique representation (or at least a standard one) in the numeral system

Modern numeral system 3  Positional base 10 numeral systems ◦ Mostly originated from India (Hindu-Arabic numeral system or Arabic numerals)  Positional number system (or place value system) ◦ use same symbol for different orders of magnitude  For example, “1262” in base 10 ◦ the “2” in the rightmost is in “one’s place” representing “2 ones” ◦ The “2” in the third position from right is in “hundred’s place”, representing “2 hundreds” ◦ “one thousand 2 hundred and sixty two” ◦ 1* * * *10 0

Modern numeral system (2) 4  In base 10 numeral system  there is 10 symbols: 0, 1, 2, 3, …, 9  Arithmetic operations for positional system is simple  Algorithm for multi-digit addition, subtraction, multiplication and division  This is a Chinese Abacus (there are many other types of Abacus in other civilizations) dated back to 200 BC

Other Positional Numeral System 5  Base: number of digits (symbols) used in the system. ◦ Base 2 (i.e., binary): only use 0 and 1 ◦ Base 8 (octal): only use 0,1,…7 ◦ Base 16 (hexadecimal): use 0,1,…9, A,B,C,D,E,F  Like in decimal system, ◦ Rightmost digit: represents its value times the base to the zeroth power ◦ The next digit to the left: times the base to the first power ◦ The next digit to the left: times the base to the second power ◦…◦… ◦ For example: binary number = 1*2 4 +0*2 3 +1*2 2 +0*2 1 +1*2 0 =16+4+1=21

Why binary number? 6  Computer uses binary numeral system, i.e., base 2 positional number system  Each unit of memory media (hard disk, tape, CD …) has two states to represent 0 and 1  Such physical (electronic) device is easier to make, less prone to error  E.g., a voltage value between 0-3mv is 0, a value between 3-6 is 1 …

Binary => Decimal 7  Interpret binary numbers (transform to base 10)  1101 = 1*2 3 +1*2 2 +0*2 1 +1*2 0 = =13  Translate the following binary number to decimal number 

Generally you can consider other bases 8  Base 8 (Octal number)  Use symbols: 0, 1, 2, …7  Convert octal number 725 to base 10: =7*8 2 +2*8 1 +5=…  Now you try: (1752) 8 =  Base 16 (Hexadecimal)  Use symbols: 0, 1, 2, …9, A, B, C,D,E, F  (10A) 16 = 1* *16 0 =..

Binary number arithmetic 9  Analogous to decimal number arithmetics  How would you perform addition?  0+0=0  0+1=1  1+1=10 (a carry-over)  Multiple digit addition: =  Subtraction:  Basic rule:  Borrow one from next left digit

From Base 10 to Base 2: using table 10 Input : a decimal number Output: the equivalent number in base 2 Procedure: Write a table as follows 1. Find the largest two’s power that is smaller than the number 1. Decimal number 234 => largest two’s power is Fill in 1 in corresponding digit, subtract 128 from the number => Repeat 1-2, until the number is 0 4. Fill in empty digits with 0 Result is …

From Base 10 to Base 2: the recipe 11 Input : a decimal number Output: the equivalent number in base 2 Procedure: 1. Divide the decimal number by 2 2. Make the remainder the next digit to the left of the answer 3. Replace the decimal number with the quotient 4. If quotient is not zero, Repeat 1-4; otherwise, done

Convert 100 to binary number % 2 = 0 => last digit 100 / 2 = % 2 = 0 => second last digit 50/2 = % 2 = 1 => 3 rd last digit 25 / 2 = % 2 = 0 => 4 th last digit 12 / 2 = 6 6 % 2 = 0 => 5 th last digit 6 / 2 = 3 3 % 2 = 1 => 6 th last digit 3 / 2 =1 1 % 2 = 1 => 7 th last digit 1 / 2 = 0 Stop as the decimal # becomes 0 The result is

Data Representation in Computer 13  In modern computers, all information is represented using binary values.  Each storage location (cell): has two states  low-voltage signal => 0  High-voltage signal => 1  i.e., it can store a binary digit, i.e., bit  Eight bits grouped together to form a byte  Several bytes grouped together to form a word  Word length of a computer, e.g., 32 bits computer, 64 bits computer

Different types of data 14  Numbers  Whole number, fractional number, …  Text  ASCII code, unicode  Audio  Image and graphics  video How can they all be represented as binary strings?

Representing Numbers 15  Positive whole numbers  We already know one way to represent them: i.e., just use base 2 number system  All integers, i.e., including negative integers  Set aside a bit for storing the sign  1 for +, 0 for –  Decimal numbers, e.g., ,  Floating point representation:  sign * mantissa * 2 exp  64 bits: one for sign, some for mantissa, some for exp.

Representing Text 16  Take English text for example  Text is a series of characters  letters, punctuation marks, digits 0, 1, …9, spaces, return (change a line), space, tab, …  How many bits do we need to represent a character?  1 bit can be used to represent 2 different things  2 bit … 2*2 = 2 2 different things  n bit 2 n different things  In order to represent 100 diff. character  Solve 2 n = 100 for n  n =, here the refers to the ceiling of x, i.e., the smallest integer that is larger than x:

There needs a standard way 17  ASCII code: American Standard Code for Information Interchange  ASCII codes represent text in computers, communications equipment, and other devices that use text.textcomputerscommunications  128 characters:  33 are non-printing control characters (now mostly obsolete) [7] that affect how text and space is processedcontrol characters [7]  94 are printable characters  space is considered an invisible graphic space

ASCII code 18

There needs a standard way 19  Unicode  international/multilingual text character encoding system, tentatively called Unicode  Currently: 21 bits code space  How many diff. characters?  Encoding forms:  UTF-8: each Unicode character represented as one to four 8-but bytes  UTF-16: one or two 16-bit code units  UTF-32: a single 32-but code unit

How computer processing data? 20  Through manipulate digital signals (high/low)  Using addition as example  Input: the two operands, each consisting of 32 bits (i.e., 32 electronic signals)  Output: the sum  How ?

Digital Logic 21  Performs operation on one or more logic inputs and produces a single logic output.  Can be implemented  electronically using diodes or transistors  Using electromagnetic relays  Or other: fluidics, optics, molecules, or even mechanical elements  We won’t go into the physics of how is it done, instead we focus on the input/output, and logic

Basic building block 22  Basic Digital logic is based on primary functions (the basic gates):  AND  OR  XOR  NOT

AND Logic Symbol 23 Inputs Output If both inputs are 1, the output is 1 If any input is 0, the output is 0

AND Logic Symbol 24 InputsOutput Determine the output Animated Slide 0 0 0

AND Logic Symbol 25 InputsOutput Determine the output Animated Slide 0 1 0

AND Logic Symbol 26 InputsOutput Determine the output Animated Slide 1 1 1

AND Truth Table 27  To help understand the function of a digital device, a Truth Table is used: InputOutput AND Function Every possible input combination

OR Logic Symbol 28 Inputs Output If any input is 1, the output is 1 If all inputs are 0, the output is 0

OR Logic Symbol 29 InputsOutput Determine the output Animated Slide 0 0 0

OR Logic Symbol 30 InputsOutput Determine the output Animated Slide 0 1 1

OR Logic Symbol 31 InputsOutput Determine the output Animated Slide 1 1 1

OR Truth Table 32  Truth Table InputOutput OR Function

The XOR function: ◦ if exactly one input is high, the output is high ◦ If both inputs are high, or both are low, the output is low XOR Gate 33

XOR Truth Table 34  Truth Table InputOutput XOR Function

NOT Logic Symbol 35 Input Output If the input is 1, the output is 0 If the input is 0, the output is 1

NOT Logic Symbol 36 Input Output Determine the output Animated Slide 0 1

NOT Logic Symbol 37 Input Output Determine the output Animated Slide 1 0

Combinational logic 38  A circuit that utilizes more that one logic function has Combinational Logic.  How would your describe the output of this combinational logic circuit?

Combinational Logic: Half Adder 39  Electronic circuit for performing single digit binary addition  Sum= A XOR B  Carry = A AND B ABSumCarry

Full Adder 40  One bit full adder with carry-in and carry-out ABCI Q CO

Full adder: 4-digit binary addition 41 Chain 4 full-adders together, lower digit’s carry-out is fed into the higher digit as carry-in

Integrated Circuit 42  Also called chip  A piece of silicon on which multiple gates are embedded  mounted on a package with pins, each pin is either an input, input, power or ground  Classification based on # of gates  VLSI (Very Large-Scale Integration) > 100,000 gates

CPU (Central Processing Unit) 43  Many pins to connect to memory, I/O  Instruction set: the set of machine instructions supported by an architecture (such as Pentium)  Move data (between register and memory)  Arithmetic Operations  Logic Operations:  Floating point arithmetic  Input/Output

In Summary 44