T02 Tutorial Slides for Week 2

Similar documents
Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

CMPE223/CMSE222 Digital Logic Design. Positional representation

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

CHW 261: Logic Design

Number System. Introduction. Decimal Numbers

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

ENEL 353: Digital Circuits Midterm Examination

Inf2C - Computer Systems Lecture 2 Data Representation

Slides for Lecture 15

Octal & Hexadecimal Number Systems. Digital Electronics

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Level ISA3: Information Representation

Switching Circuits and Logic Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Lecture 2: Number Systems

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Number Systems. TA: Mamun. References: Lecture notes of Introduction to Information Technologies (ITEC 1011) by Dr Scott MacKenzie

MACHINE LEVEL REPRESENTATION OF DATA

CS101 Lecture 04: Binary Arithmetic

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

CS 31: Intro to Systems Binary Representation. Kevin Webb Swarthmore College September 6, 2018

Integer Multiplication and Division

ENCM 501 Winter 2015 Tutorial for Week 5

Chapter 3: Arithmetic for Computers

BINARY SYSTEM. Binary system is used in digital systems because it is:

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Binary Representations and Arithmetic

Introduction to Computers and Programming. Numeric Values

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Slide Set 5. for ENCM 369 Winter 2014 Lecture Section 01. Steve Norman, PhD, PEng

ENEL Digital Circuits Midterm Examination

Slide Set 2. for ENCM 335 in Fall Steve Norman, PhD, PEng

CPS 104 Computer Organization and Programming Lecture-2 : Data representations,

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...

Slide Set 3. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Lecture 8: Addition, Multiplication & Division

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs

QUIZ: Generations of computer technology. Hardware:

COMP Overview of Tutorial #2

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

EE292: Fundamentals of ECE

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Slide Set 5. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

INF2270 Spring Philipp Häfliger. Lecture 4: Signed Binaries and Arithmetic

Binary Arithmetic CS 64: Computer Organization and Design Logic Lecture #2 Fall 2018

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Binary Adders: Half Adders and Full Adders

CS 101: Computer Programming and Utilization

Advanced Computer Architecture-CS501

CS & IT Conversions. Magnitude 10,000 1,

Signed umbers. Sign/Magnitude otation

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

CS 31: Intro to Systems Binary Representation. Kevin Webb Swarthmore College January 27, 2015

Number Systems & Encoding

EE 109 Unit 6 Binary Arithmetic

CHAPTER 2 (b) : AND CODES

Chapter 2. Binary Values and Number Systems

Chapter 2 Data Representations

ENCM 335 Fall 2018 Tutorial for Week 13

Korea University of Technology and Education

Octal and Hexadecimal Integers

Chapter 1 Review of Number Systems

World Inside a Computer is Binary

CS/EE1012 INTRODUCTION TO COMPUTER ENGINEERING SPRING 2013 HOMEWORK I. Solve all homework and exam problems as shown in class and sample solutions

Data Representations & Arithmetic Operations

Computer Organization

COMP2611: Computer Organization. Data Representation

Information Science 1

NUMBER OPERATIONS. Mahdi Nazm Bojnordi. CS/ECE 3810: Computer Organization. Assistant Professor School of Computing University of Utah

MC1601 Computer Organization

Digital Fundamentals

CHAPTER 2 Number Systems

Computer Arithmetic. Appendix A Fall 2003 Lec.03-58

UNIT 7A Data Representation: Numbers and Text. Digital Data

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

TOPIC: NUMBER SYSTEMS

Chapter 3: part 3 Binary Subtraction

Data Representation. DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations.

data within a computer system are stored in one of 2 physical states (hence the use of binary digits)

Number Systems CHAPTER Positional Number Systems

CSE 20. Lecture 4: Number System and Boolean Function. CSE 20: Lecture2

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Number representations

CS 64 Week 0 Lecture 1. Kyle Dewey

Kinds Of Data CHAPTER 3 DATA REPRESENTATION. Numbers Are Different! Positional Number Systems. Text. Numbers. Other

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

Number Systems Base r

Lecture 1: Digital Systems and Number Systems

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

Transcription:

T02 Tutorial Slides for Week 2 ENEL 353: Digital Circuits Fall 2017 Term Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary 19 September, 2017

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 2/13 Tutorials in ENEL 353 Some tutorials, like today s, will be used for review and example problems. Other tutorials, 5 in total, will be used for 50-minute quizzes. Each quiz counts for 3% of your course grade. The first quiz is next week, Sept. 26. Dates of all the other quizzes will be announced well in advance.

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 3/13 Exercise 1 Complete the table... decimal binary hex decimal binary hex 0 0000 0 8 1000 8 1 0001 1 9 2 0010 2 10 3 11 4 12 5 13 6 14 7 15

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 4/13 Exercise 2 Complete the table. (It s really useful to have these powers of two memorized! It s a good idea to practice writing out the table until it becomes automatic.) N 2 N 0 1 2 2 4 3 8 4 5 6 7 8 9 10 11 12

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 5/13 Review of number systems Number layout: Each d k is a digit... d N d N 1 d 1 d 0. d 1 d 2 d P Integer part: d N d N 1 d 1 d 0 Fraction part: 0. d 1 d 2 d P Each digit belongs to the set {0, 1,..., r 1} where r is the radix or base of the system. Radix ten corresponds to the decimal system, which is what humans use in daily life.

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 6/13 Review of number system conversions Radix r to decimal: Use the power series formula... N d k r k k= P Exercise 3: Convert 2D.8 16 to decimal. Exercise 4: Convert 2102 3 to decimal. (Don t expect to see radix 3 ever again in ENEL 353!)

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 7/13 Review of number system conversions Decimal integer to radix r: Do repeated division by r; digits are remainders from the divisions. Exercise 5: Convert 26 10 to radix 2. (Decimal fraction to radix r: Do repeated multiplication by r; digits are integer parts from the multiplications. Knowledge of the algorithm for fractions is optional in ENEL 353.)

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 8/13 Octal (radix 8) and hexadecimal (radix 16) number systems Exercise 6: Convert 253 8 and 10B 16 to decimal. Exercise 7: Convert 75 10 to octal, binary, and hex.

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 9/13 Signed and unsigned number systems Signed and unsigned are words used to describe number systems, but NOT individual numbers or bit patterns. Signed systems include negative numbers, zero, and positive numbers. Unsigned systems have only zero and positive numbers. Two different systems for signed integers are sign/magnitude and two s complement. In both systems, the MSB is the sign bit: 1 means negative.

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 10/13 Unsigned binary addition Rules for adding three 1 bit values to produce a 2 bit sum... know these rules! 0 + 0 + 0 = 0 0 0 + 0 + 1 = 0 1 0 + 1 + 0 = 0 1 0 + 1 + 1 = 1 0 1 + 0 + 0 = 0 1 1 + 0 + 1 = 1 0 1 + 1 + 0 = 1 0 1 + 1 + 1 = 1 1 Exercise 8: Compute the results of these 4-bit unsigned additions... 1011 2 + 0010 2 0101 2 + 1110 2 carry bit sum bit

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 11/13 Two s complement negation rule To negate a two s-complement number, invert all the bits, then add 1 using unsigned binary addition. Exercise 9: 0101 is the 4-bit two s-complement representation of +5 10. What is the 4-bit two s-complement representation of 5 10? Exercise 10: 1100 is the 4-bit two s-complement representation of 4 10. Find the 4-bit two s-complement representation of +4 10 using two s-complement negation.

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 12/13 To know what a bit pattern means, you have to know what number system is in use! Exercise 11: Find decimal values corresponding to the bit pattern 101100, viewed as 6-bit unsigned, 6-bit sign/magnitude, and 6-bit two s-complement.

ENEL 353 F17 T02 Tutorial Slides for Week 2 slide 13/13 Two s complement addition A preview of upcoming lecture material: To add numbers in a two s complement system, just add them as if they were unsigned binary numbers! Exercise 12: Let s show that 2 10 + 3 10 = 5 10 using 4-bit two s-complement arithmetic.