CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.

Slides:



Advertisements
Similar presentations
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Advertisements

CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math Prof. Shachar Lovett
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 Discrete math Prof. Shachar Lovett
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Arithmetic Operations and Circuits
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
Digital Circuits. Analog and Digital Signals Noise margins in Logic Circuits VMVM.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
Number System and Codes
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
FIGURES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Mantıksal Tasarım – BBM231 M. Önder Efe
©2008 The McGraw-Hill Companies, Inc. All rights reserved. Digital Electronics Principles & Applications Seventh Edition Chapter 10 Arithmetic Circuits.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Computer Organization & Programming Chapter2 Number Representation and Logic Operations.
Chapter 7 Arithmetic Operations and Circuits Binary Arithmetic Addition –When the sum exceeds 1, carry a 1 over to the next-more-significant column.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Logic and Digital System Design - CS 303
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
1 CMSC 250 Chapter 1, con't., Combinatorial circuits.
Integer Conversion Between Decimal and Binary Bases Conversion of decimal to binary more complicated Task accomplished by –Repeated division of decimal.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Positional Number Systems
Lecture 9 Topics: –Combinational circuits Basic concepts Examples of typical combinational circuits –Half-adder –Full-adder –Ripple-Carry adder –Decoder.
ECE 2110: Introduction to Digital Systems Signed Addition/Subtraction.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
Addition and Substraction
1 Understand the examples again Overflow –When two positive numbers added together or a negative number subtracted from a positive number yields negative.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Lecture 2 Binary Arithmetic Topics Terminology Fractions Base-r to decimal Unsigned Integers Signed magnitude Two’s complement August 26, 2003 CSCE 211.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
1 4. Computer Maths and Logic 4.1 Number Systems.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Chapter 1: Binary Systems
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
1 Digital Logic Design Engr. Kashif Shahzad. 2 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level.
Computer Organization 1 Data Representation Negative Integers.
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)
COSC2410: LAB 2 BINARY ARITHMETIC SIGNED NUMBERS FLOATING POINT REPRESENTATION BOOLEAN ALGEBRA 1.
Unit I From Fundamentals of Logic Design by Roth and Kinney.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 102 Introduction to Computer Engineering
Chapter 14 Bitwise Operators Objectives
Negatives, Addition, Subtraction
CPS120: Introduction to Computer Science
Chapter 8 Computer Arithmetic
Introduction To Number Systems
Presentation transcript:

CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA

Todays topics Algorithms: number systems, binary representation Section 1.3 in Jenkyns, Stephenson

Numbers are building blocks

Positional representation JS p. 22 What’s the (decimal) value of {2}? A. 5 {10} B. 17 {10} C. -1 {10} D {10} E. None of the above / more than one of the above.

Positional representation JS p. 22 What’s the base 2 representation of the (decimal) number 42 {10}? A {2} B {2} C {2} D {2} E. None of the above / more than one of the above.

Positional representation JS p. 22 What’s the biggest integer value whose binary representation has 4 bits? A. 2 4 = 16 {10} B. 2 3 = 8 {10} C. 4 {10} D {10} E. None of the above / more than one of the above.

Uniqueness Is it possible to have ? A. No. B. Yes, but m has to be the same as n. C. Yes, and m,n can be different but for each kind of coefficient that appears in both, it has to agree. That is, a 0 = b 0, a 1 = b 1, etc. D. Yes, if m=n and all the coefficients agree. E. More than one of the above / none of the above.

Parity and shift

Shifts

Positional representation JS p. 22 What’s the base 2 representation of the (decimal) number 2014 {10}? A {2} B {2} C {2} D {2} E. None of the above / more than one of the above.

Positional representation JS p. 22 What’s the base 2 representation of the (decimal) number 2014 {10}? A {2} B {2} C {2} D {2} E. None of the above / more than one of the above. Is there a systematic way (aka algorithm) to do it?

Decimal to Binary conversion Right to left Questions to ask: Does it always terminate? Does it give the correct answer? What is the time complexity? toBinary(pos int n) Begin x  “”; i  n; While i>0 Do If (i is even) Then x  “0”.x; End; If (i is odd) Then x  “1”.x; End; i  i/2; Output x End.

Other numbers? Fractional components Negative numbers aka how to subtract … first, how do we add? A. 111 B. 100 C D E. None of the above.

One bit addition Carry:

Subtraction JS p. 6 Borrowing A – B = (A – 10) + (10 – B) Carrying A – B = (A+10) – (B+10) Complementation A – B = A + B c = A + [ (99-B) - 99 ] = A + [ (100-B) – 100 ]

2’s complement Complete the wheel of numbers! How many numbers are we representing with 4 bits?

How to add binary numbers? ? ? ? ? ?

How to add binary numbers? ? ? ? ? ? ? ? ? (carry) ? ? ? ? ?

How to add binary numbers? Two basic operations: One-Bit-Addition(bit1, bit2, carry) Next-carry(bit1, bit2, carry) ? ? ? ? ? ? ? ? (carry) ? ? ? ? ?

Numbers … logic … circuits

Next class Boolean circuits and truth tables Read sections in Jenkyns, Stephenson