ENGIN 112 Intro to Electrical and Computer Engineering

Similar documents
ENGIN 112 Intro to Electrical and Computer Engineering

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

Week No. 06: Numbering Systems

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

Conversions between Decimal and Binary

ENG2410 Digital Design Introduction to Digital Systems. Fall 2017 S. Areibi School of Engineering University of Guelph

Design of Digital Circuits Reading: Binary Numbers. Required Reading for Week February 2017 Spring 2017

CSEN102 Introduction to Computer Science

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

Number Bases. Ioan Despi. University of New England. August 4, 2013

CPE100: Digital Logic Design I

Binary addition example worked out

CHAPTER 2 NUMBER SYSTEMS

Why digital? Overview. Number Systems. Binary to Decimal conversion

Computer Number Systems

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems

ECE380 Digital Logic. Positional representation

Counting in Different Number Systems

Number Theory: Representations of Integers

DESIGN AND IMPLEMENTATION OF ENCODERS AND DECODERS. To design and implement encoders and decoders using logic gates.

12/31/2010. Digital Operations and Computations Course Notes. 01-Number Systems Text: Unit 1. Overview. What is a Digital System?

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

Cs302 Quiz for MID TERM Exam Solved

CSCI 255. S i g n e d N u m s / S h i f t i n g / A r i t h m e t i c O p s.

Chapter 1 CSCI

of Digital Electronics

CSE 241 Digital Systems Spring 2013

Introduction to Digital Logic Missouri S&T University CPE 2210 Number Systems

Digital Systems Overview. Unit 1 Numbering Systems. Why Digital Systems? Levels of Design Abstraction. Dissecting Decimal Numbers

1 Computing System 2. 2 Data Representation Number Systems 22

CHAPTER 7. Exercises 17/ / /2 2 0

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

Digital Systems Roberto Muscedere Images 2013 Pearson Education Inc. 1

Introduction to Digital Logic Missouri S&T University CPE 2210 Number Systems

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

Digital Electronics Part 1: Binary Logic

NUMBERS AND CODES CHAPTER Numbers

We say that the base of the decimal number system is ten, represented by the symbol

Outline. policies for the first part. with some potential answers... MCS 260 Lecture 10.0 Introduction to Computer Science Jan Verschelde, 9 July 2014

CISC 1400 Discrete Structures

Discrete Mathematics GCD, LCM, RSA Algorithm

UNIVERSITI TENAGA NASIONAL. College of Information Technology

CSE 20: Discrete Mathematics

Section 3-4: Least Common Multiple and Greatest Common Factor

Four Important Number Systems

3 The fundamentals: Algorithms, the integers, and matrices

0,..., r 1 = digits in radix r number system, that is 0 d i r 1 where m i n 1

2.5 정수와알고리즘 (Integers and Algorithms)

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

Physics 310 Lecture 10 Microprocessors

Base-b representations of integers. (b 진법표현 ) Algorithms for computer arithmetic: Euclidean algorithm for finding GCD s.

hexadecimal-to-decimal conversion

CSE 20 DISCRETE MATH. Fall

Introduction to digital systems. Juan P Bello

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation

Number System conversions

Number Representation and Waveform Quantization

17.1 Binary Codes Normal numbers we use are in base 10, which are called decimal numbers. Each digit can be 10 possible numbers: 0, 1, 2, 9.

Chapter 1 :: From Zero to One

Combinational Logic. By : Ali Mustafa

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

Chapter 9 - Number Systems

Math 230 Assembly Language Programming (Computer Organization) Numeric Data Lecture 2

4 Number Theory and Cryptography

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Introduction CSE 541

Computer Organization I Test 1/Version 1 CMSC 2833 Autumn 2007

THE LOGIC OF COMPOUND STATEMENTS

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

The Magic of Negative Numbers in Computers

FYSE410 DIGITAL ELECTRONICS [1] [2] [3] [4] [5] A number system consists of an ordered set of symbols (digits).

Numbers and Arithmetic

Numbers and Arithmetic

EDULABZ INTERNATIONAL NUMBER SYSTEM

A number that can be written as, where p and q are integers and q Number.

Informatics 1 - Computation & Logic: Tutorial 3

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

Maths Scheme of Work. Class: Year 10. Term: autumn 1: 32 lessons (24 hours) Number of lessons

Fundamentals of Digital Design

Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS

CS1800 Discrete Structures Spring 2018 February CS1800 Discrete Structures Midterm Version A

Systems I: Computer Organization and Architecture

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic

Advanced Information Storage 02

Chapter 1. Binary Systems 1-1. Outline. ! Introductions. ! Number Base Conversions. ! Binary Arithmetic. ! Binary Codes. ! Binary Elements 1-2

10/14/2009. Reading: Hambley Chapters

CpE358/CS381. Switching Theory and Logical Design. Summer

Part 5: Digital Circuits

CPE100: Digital Logic Design I

What are binary numbers and why do we use them? BINARY NUMBERS. Converting decimal numbers to binary numbers

Chapter 2. Review of Digital Systems Design

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Module 2. Basic Digital Building Blocks. Binary Arithmetic & Arithmetic Circuits Comparators, Decoders, Encoders, Multiplexors Flip-Flops

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank

CHAPTER 7. Solutions for Exercises

Save from: cs. Logic design 1 st Class أستاذ المادة: د. عماد

Transcription:

ENGIN 112 Intro to Electrical and Computer Engineering Lecture 2 Number Systems Russell Tessier KEB 309 G tessier@ecs.umass.edu

Overview The design of computers It all starts with numbers Building circuits Building computing machines Digital systems Understanding decimal numbers Binary and octal numbers The basis of computers! Conversion between different number systems

Digital Computer Systems Digital systems consider discrete amounts of data. Examples 26 letters in the alphabet 10 decimal digits Larger quantities can be built from discrete values: Words made of letters Numbers made of decimal digits (e.g. 239875.32) Computers operate on binary values (0 and 1) Easy to represent binary values electrically Voltages and currents. Can be implemented using circuits Create the building blocks of modern computers

Understanding Decimal Numbers Decimal numbers are made of decimal digits: (0,1,2,3,4,5,6,7,8,9) But how many items does a decimal number represent? 8653 = 8x10 3 + 6x10 2 + 5x10 1 + 3x10 0 What about fractions? 97654.35 = 9x10 4 + 7x10 3 + 6x10 2 + 5x10 1 + 4x10 0 + 3x10-1 + 5x10-2 In formal notation -> (97654.35) 10 Why do we use 10 digits, anyway?

Understanding Octal Numbers Octal numbers are made of octal digits: (0,1,2,3,4,5,6,7) How many items does an octal number represent? (4536) 8 = 4x8 3 + 5x8 2 + 3x8 1 + 6x8 0 = (1362) 10 What about fractions? (465.27) 8 = 4x8 2 + 6x8 1 + 5x8 0 + 2x8-1 + 7x8-2 Octal numbers don t use digits 8 or 9 Who would use octal number, anyway?

Understanding Binary Numbers Binary numbers are made of binary digits (bits): 0 and 1 How many items does an binary number represent? (1011) 2 = 1x2 3 + 0x2 2 + 1x2 1 + 1x2 0 = (11) 10 What about fractions? (110.10) 2 = 1x2 2 + 1x2 1 + 0x2 0 + 1x2-1 + 0x2-2 Groups of eight bits are called a byte (11001001) 2 Groups of four bits are called a nibble. (1101) 2

Why Use Binary Numbers? Easy to represent 0 and 1 using electrical values. Possible to tolerate noise. Easy to transmit data Easy to build binary circuits. AND Gate 1 0 0

Conversion Between Number Bases Octal(base 8) Decimal(base 10) Binary(base 2) Learn to convert between bases. Already demonstrated how to convert from binary to decimal. Hexadecimal described in next lecture. Hexadecimal (base16)

Convert an Integer from Decimal to Another Base For each digit position: 1. Divide decimal number by the base (e.g. 2) 2. The remainder is the lowest-order digit 3. Repeat first two steps until no divisor remains. Example for (13) 10: Integer Quotient Remainder Coefficient 13/2 = 6 + ½ a 0 = 1 6/2 = 3 + 0 a 1 = 0 3/2 = 1 + ½ a 2 = 1 1/2 = 0 + ½ a 3 = 1 Answer (13) 10 = (a 3 a 2 a 1 a 0 ) 2 = (1101) 2

Convert an Fraction from Decimal to Another Base For each digit position: 1. Multiply decimal number by the base (e.g. 2) 2. The integer is the highest-order digit 3. Repeat first two steps until fraction becomes zero. Example for (0.625) 10: Integer Fraction Coefficient 0.625 x 2 = 1 + 0.25 a -1 = 1 0.250 x 2 = 0 + 0.50 a -2 = 0 0.500 x 2 = 1 + 0 a -3 = 1 Answer (0.625) 10 = (0.a -1 a -2 a -3 ) 2 = (0.101) 2

The Growth of Binary Numbers n 2 n n 2 n 0 2 0 =1 8 2 8 =256 1 2 1 =2 9 2 9 =512 2 2 2 =4 10 2 10 =1024 3 2 3 =8 11 2 11 =2048 4 2 4 =16 12 2 12 =4096 5 2 5 =32 20 2 20 =1M Mega 6 2 6 =64 30 2 30 =1G Giga 7 2 7 =128 40 2 40 =1T Tera

Binary Addition Binary addition is very simple. This is best shown in an example of adding two binary numbers 1 1 1 1 1 1 1 0 1 + 1 0 1 1 1 --------------------- 1 0 1 0 1 0 0 1 1 1 carries

Binary Subtraction We can also perform subtraction (with borrows in place of carries). Let s subtract (10111) 2 from (1001101) 2 1 10 0 10 10 0 0 10 borrows 1 0 0 1 1 0 1-1 0 1 1 1 ------------------------ 1 1 0 1 1 0

Binary Multiplication Binary multiplication is much the same as decimal multiplication, except that the multiplication operations are much simpler 1 0 1 1 1 X 1 0 1 0 ----------------------- 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 0 1 1 1 ----------------------- 1 1 1 0 0 1 1 0

Convert an Integer from Decimal to Octal For each digit position: 1. Divide decimal number by the base (8) 2. The remainder is the lowest-order digit 3. Repeat first two steps until no divisor remains. Example for (175) 10: Integer Quotient Remainder Coefficient 175/8 = 21 + 7/8 a 0 = 7 21/8 = 2 + 5/8 a 1 = 5 2/8 = 0 + 2/8 a 2 = 2 Answer (175) 10 = (a 2 a 1 a 0 ) 2 = (257) 8

Convert an Fraction from Decimal to Octal For each digit position: 1. Multiply decimal number by the base (e.g. 8) 2. The integer is the highest-order digit 3. Repeat first two steps until fraction becomes zero. Example for (0.3125) 10: Integer Fraction Coefficient 0.3125 x 8 = 2 + 5 a -1 = 2 0.5000 x 8 = 4 + 0 a -2 = 4 Answer (0.3125) 10 = (0.24) 8

Summary Binary numbers are made of binary digits (bits) Binary and octal number systems Conversion between number systems Addition, subtraction, and multiplication in binary