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

Similar documents
T02 Tutorial Slides for Week 2

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

Copy: IF THE PROGRAM or OUTPUT is Copied, then both will have grade zero.

Lecture 25: Other Number Systems

Basic circuit analysis and design. Circuit analysis. Write algebraic expressions or make a truth table

CSE 115. Introduction to Computer Science I

Binary Values. CSE 410 Lecture 02

Conversion Between Number Bases

CS101 Lecture 04: Binary Arithmetic

ENEE x Digital Logic Design. Lecture 3

Lecture 22: Implementing Combinational Logic

Lecture 10: Floating Point, Digital Design

Binary Adders: Half Adders and Full Adders

CSE 373: Data Structures and Algorithms

How a Digital Binary Adder Operates

CSE 201 JAVA PROGRAMMING I. Copyright 2016 by Smart Coding School

CSE 20 Discrete Mathematics

COSC 243. Data Representation 3. Lecture 3 - Data Representation 3 1. COSC 243 (Computer Architecture)

CS1800 Discrete Structures Final Version A

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,...

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

Lecture 2. Variables & Assignment

CMPSCI 250: Introduction to Computation. Lecture #1: Things, Sets and Strings David Mix Barrington 22 January 2014

Programming in C++ PART 2

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Integers II. CSE 351 Autumn 2018

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

CS 327E Class 3. February 11, 2019

Values, Variables, Types & Arithmetic Expressions. Agenda

Computer Systems C S Cynthia Lee

CSE 20 DISCRETE MATH WINTER

ENGR 102 Engineering Lab I - Computation

CSE548, AMS542: Analysis of Algorithms, Fall 2012 Date: October 16. In-Class Midterm. ( 11:35 AM 12:50 PM : 75 Minutes )

Student Number: UTORid: Question 0. [1 mark] Read and follow all instructions on this page, and fill in all fields.

SYNERGY INSTITUTE OF ENGINEERING & TECHNOLOGY,DHENKANAL LECTURE NOTES ON DIGITAL ELECTRONICS CIRCUIT(SUBJECT CODE:PCEC4202)

Visual Basic for Applications

CS4800: Algorithms & Data Jonathan Ullman

Lecture (03) Binary Codes Registers and Logic Gates

CS 101 Computer Programming and utilization. Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal Rekhi Building IIT Bombay

Information Science 1

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)

CMPSCI 250: Introduction to Computation. Lecture #14: Induction and Recursion (Still More Induction) David Mix Barrington 14 March 2013

CMSC201 Computer Science I for Majors

Von Neumann Architecture

Information Science 1

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis

Standard Boolean Forms

Inf2C - Computer Systems Lecture 2 Data Representation

CSE 20 DISCRETE MATH. Winter

Summary of Lecture 4. Computer Programming: Skills & Concepts (INF-1-CP1) Variables; scanf; Conditional Execution. Tutorials.

Lecture 1. Course Overview Types & Expressions

Integers II. CSE 351 Autumn Instructor: Justin Hsia

COMP Primitive and Class Types. Yi Hong May 14, 2015

Today. Types of graphs. Complete Graphs. Trees. Hypercubes.

The. Binary. Number System

Outline. Review of Last Week II. Review of Last Week. Computer Memory. Review Variables and Memory. February 7, Data Types

IST 4 Information and Logic

Lecture 2: Variables & Assignments

CSE 351: The Hardware/Software Interface. Section 2 Integer representations, two s complement, and bitwise operators

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

FLIPPED CLASS F#3- Number System. Department of CSE, Coimbatore CTPS 2018

CSE 21: Mathematics for Algorithms and Systems Analysis

Lecture 3: Binary Subtraction, Switching Algebra, Gates, and Algebraic Expressions

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

(Type your answer in radians. Round to the nearest hundredth as needed.)

CSE 143 Lecture 11. Decimal Numbers

Department of Computer Science Purdue University, West Lafayette

Lecture (04) Boolean Algebra and Logic Gates

Lecture (04) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Invitation to Computer Science, C++ Version, Third Edition

Complexity and Advanced Algorithms Monsoon Parallel Algorithms Lecture 2

Boolean Analysis of Logic Circuits

Outline for Today CSE 142. CSE142 Wi03 G-1. withdraw Method for BankAccount. Class Invariants

An Annotated Language

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

CS/COE 0447 Example Problems for Exam 2 Spring 2011

CMPE223/CMSE222 Digital Logic Design. Positional representation

Lecture 10: Floating Point, Digital Design

Review Functions. Natural Language and Dialogue Systems Lab

CPSC 121: Models of Computation

CSE 417 Network Flows (pt 4) Min Cost Flows

Recap from Last Time. CSE 2021: Computer Organization. It s All about Numbers! 5/12/2011. Text Pictures Video clips Audio

Lecture 5: More Examples/Applications of Quasirandom Graphs

DIGITAL CIRCUIT LOGIC UNIT 7: MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES

CSE303 Logic Design II Laboratory 01

Lecture 1. Course Overview, Python Basics

CSC 120 Computer Science for the Sciences. Week 1 Lecture 2. UofT St. George January 11, 2016

Decimals Outcomes. Represent Q Using Decomposition

Lecture: Analysis of Algorithms (CS )

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

Chapter 4. Operations on Data

Digital Circuits ECS 371

EE292: Fundamentals of ECE

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 4 Notes. Class URL:

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

CSE 452: Programming Languages. Outline of Today s Lecture. Expressions. Expressions and Control Flow

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

CSE 20 DISCRETE MATH. Fall

Transcription:

CSE 20 Lecture 4: Number System and Boolean Function

Next Weeks Next week we will do Unit:NT, Section 1. There will be an assignment set posted today. It is just for practice.

Boolean Functions and Number System

Boolean Functions and Number System Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Boolean Functions and Number System Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 What does 217 read like?

Boolean Functions and Number System Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 What does 217 read like? Usually we represent our number in decimal representation. Like: 217 = 2 10 2 + 1 10 + 7

Numbers with base b Usually we represent our number in decimal representation. Like: 217 = 2 10 2 + 1 10 + 7

Numbers with base b Usually we represent our number in decimal representation. Like: 217 = 2 10 2 + 1 10 + 7 One can represent a number is any base.

Numbers with base b Usually we represent our number in decimal representation. Like: 217 = 2 10 2 + 1 10 + 7 One can represent a number is any base. Like: 217 = 2 3 4 + 2 3 3 + 0 3 2 + 0 3 + 1

Numbers with base b Usually we represent our number in decimal representation. Like: 217 = 2 10 2 + 1 10 + 7 One can represent a number is any base. Like: 217 = 2 3 4 + 2 3 3 + 0 3 2 + 0 3 + 1 Thus 217 = [22001] 3.

Numbers with base b Usually we represent our number in decimal representation. Like: 217 = 2 10 2 + 1 10 + 7 One can represent a number is any base. Like: 217 = 2 3 4 + 2 3 3 + 0 3 2 + 0 3 + 1 Thus 217 = [22001] 3. One can represent a number in any base.

Base b representation

Base b representation Digits: 0, 1,..., b 1

Base b representation Digits: 0, 1,..., b 1 Represented as [x] b. (Like [22001] 3 )

Base b representation Digits: 0, 1,..., b 1 Represented as [x] b. (Like [22001] 3 ) Base b representation of a number x is the unique way of writing x = x 0 b 0 + x 1 b 1 + + x k b k, where x 0, x 1,..., x k {0, 1,..., (b 1)}

Base b representation Digits: 0, 1,..., b 1 Represented as [x] b. (Like [22001] 3 ) Base b representation of a number x is the unique way of writing x = x 0 b 0 + x 1 b 1 + + x k b k, where x 0, x 1,..., x k {0, 1,..., (b 1)} So, x = [x k x k 1... x 1 x 0 ] b

Questions 1 Why and how can any integer be written in any base?

Questions 1 Why and how can any integer be written in any base? Given an method or algorithm to find the representation given x and b.

Questions 1 Why and how can any integer be written in any base? Given an method or algorithm to find the representation given x and b. 2 Why does an integer has an unique representation in a base b?

Questions 1 Why and how can any integer be written in any base? Given an method or algorithm to find the representation given x and b. 2 Why does an integer has an unique representation in a base b? If an algorithm A 1 write x = [x k x k 1... x 0 ] b and another algorithm A 2 write x = [y k y k 1... y 0 ] b, then is the two representations same.

Questions 1 Why and how can any integer be written in any base? Given an method or algorithm to find the representation given x and b. 2 Why does an integer has an unique representation in a base b? If an algorithm A 1 write x = [x k x k 1... x 0 ] b and another algorithm A 2 write x = [y k y k 1... y 0 ] b, then is the two representations same. In other words, is y i = x i for all 0 i k?

iclicker question What is the representation of 6102 in binary?

iclicker question What is the representation of 6102 in binary? 1 [1011111011100] 2 2 [20110200011] 2 3 [111111111111] 2 4 [1011111011110] 2

iclicker question What is the sum of [24887] 9 and [13808] 9?

iclicker question What is the sum of [24887] 9 and [13808] 9? 1 [38806] 9 2 [38695] 9 3 [38696] 9 4 [38886] 9

Addition is base b representation

Addition is base b representation Add as numbers and represent in the base b representation.

Addition is base b representation Add as numbers and represent in the base b representation. For example: In base 3 [2] 3 + [1] 3 = [10] 3

Addition is base b representation Add as numbers and represent in the base b representation. For example: In base 3 [2] 3 + [1] 3 = [10] 3 [11] 3 + [12] 3 = [100] 3

Addition is base b representation Add as numbers and represent in the base b representation. For example: In base 3 [2] 3 + [1] 3 = [10] 3 [11] 3 + [12] 3 = [100] 3 [121] 3 + [22] 3 = [220] 3

iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b)

iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 < 2 10 2 2 10 3 Depends on the values of a and b 4 Can t Say

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b)

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256.

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512 (2 9 a) + (2 9 b) = (2 9 + 2 9 ) (a + b)

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512 (2 9 a) + (2 9 b) = (2 9 + 2 9 ) (a + b) = 2 10 (a + b)

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512 (2 9 a) + (2 9 b) = (2 9 + 2 9 ) (a + b) = 2 10 (a + b) Since (a + b) > 0

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512 (2 9 a) + (2 9 b) = (2 9 + 2 9 ) (a + b) = 2 10 (a + b) Since (a + b) > 0 and so (2 9 a) + (2 9 b) = 2 10 (a + b) < 2 10

iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b)

iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 2 9 2 2 9 3 > 2 9 4 Depends on the values of a and b

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b)

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256.

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512 (2 9 a) + (2 9 b) = 2 9 + (2 9 (a + b))

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512 (2 9 a) + (2 9 b) = 2 9 + (2 9 (a + b)) Since (a + b) 512 so 2 9 (a + b) 0

Proof of iclicker question If a and b are integers in the range 1 and 256 then is (2 9 a) + (2 9 b) 1 a 256 and 1 b 256. So 2 a + b 512 (2 9 a) + (2 9 b) = 2 9 + (2 9 (a + b)) Since (a + b) 512 so 2 9 (a + b) 0 and so (2 9 a) + (2 9 b) 2 9