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

Size: px
Start display at page:

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

Transcription

1 CSE 20 Lecture 4: Number System and Boolean Function

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

3 Boolean Functions and Number System

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

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

6 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 =

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

8 Numbers with base b Usually we represent our number in decimal representation. Like: 217 = One can represent a number is any base.

9 Numbers with base b Usually we represent our number in decimal representation. Like: 217 = One can represent a number is any base. Like: 217 =

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

11 Numbers with base b Usually we represent our number in decimal representation. Like: 217 = One can represent a number is any base. Like: 217 = Thus 217 = [22001] 3. One can represent a number in any base.

12 Base b representation

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

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

15 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 x k b k, where x 0, x 1,..., x k {0, 1,..., (b 1)}

16 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 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

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

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

19 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?

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

21 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?

22 iclicker question What is the representation of 6102 in binary?

23 iclicker question What is the representation of 6102 in binary? 1 [ ] 2 2 [ ] 2 3 [ ] 2 4 [ ] 2

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

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

26 Addition is base b representation

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

28 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

29 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

30 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

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

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

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

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

35 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

36 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) = ( ) (a + b)

37 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) = ( ) (a + b) = 2 10 (a + b)

38 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) = ( ) (a + b) = 2 10 (a + b) Since (a + b) > 0

39 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) = ( ) (a + b) = 2 10 (a + b) Since (a + b) > 0 and so (2 9 a) + (2 9 b) = 2 10 (a + b) < 2 10

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

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

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

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

44 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

45 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 (a + b))

46 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 (a + b)) Since (a + b) 512 so 2 9 (a + b) 0

47 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 (a + b)) Since (a + b) 512 so 2 9 (a + b) 0 and so (2 9 a) + (2 9 b) 2 9

T02 Tutorial Slides for Week 2

T02 Tutorial Slides for Week 2 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

More information

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

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal Positional notation Ch.. /continued Conversions between Decimal and Binary Binary to Decimal - use the definition of a number in a positional number system with base - evaluate the definition formula using

More information

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

Copy: IF THE PROGRAM or OUTPUT is Copied, then both will have grade zero. THIS IS HOMEWORK FOR PART-1 OF C/C++ COURSE Instructor: Prof Yahia Halabi Submit: Before exam-1 period [one week from 24/02/2013] Groups: Allowed to work in groups, but at the end, everyone should submit

More information

Lecture 25: Other Number Systems

Lecture 25: Other Number Systems Lecture 25: Other Number Systems Today s Goals Learn about Gray Codes Use scaled binary numbers Learn the IEEE floating point number format Gray Codes Rotational Position Encoded with Standard Binary Gray

More information

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

Basic circuit analysis and design. Circuit analysis. Write algebraic expressions or make a truth table Basic circuit analysis and design Circuit analysis Circuit analysis involves figuring out what some circuit does. Every circuit computes some function, which can be described with Boolean expressions or

More information

CSE 115. Introduction to Computer Science I

CSE 115. Introduction to Computer Science I CSE 115 Introduction to Computer Science I Note about posted slides The slides we post will sometimes contain additional slides/content, beyond what was presented in any one lecture. We do this so the

More information

Binary Values. CSE 410 Lecture 02

Binary Values. CSE 410 Lecture 02 Binary Values CSE 410 Lecture 02 Lecture Outline Binary Decimal, Binary, and Hexadecimal Integers Why Place Value Representation Boolean Algebra 2 First: Why Binary? Electronic implementation Easy to store

More information

Conversion Between Number Bases

Conversion Between Number Bases Conversion Between Number Bases MATH 100 Survey of Mathematical Ideas J. Robert Buchanan Department of Mathematics Summer 2018 General Number Bases Bases other than 10 are sometimes used in numeration

More information

CS101 Lecture 04: Binary Arithmetic

CS101 Lecture 04: Binary Arithmetic CS101 Lecture 04: Binary Arithmetic Binary Number Addition Two s complement encoding Briefly: real number representation Aaron Stevens (azs@bu.edu) 25 January 2013 What You ll Learn Today Counting in binary

More information

ENEE x Digital Logic Design. Lecture 3

ENEE x Digital Logic Design. Lecture 3 ENEE244-x Digital Logic Design Lecture 3 Announcements Homework due today. Homework 2 will be posted by tonight, due Monday, 9/2. First recitation quiz will be tomorrow on the material from Lectures and

More information

Lecture 22: Implementing Combinational Logic

Lecture 22: Implementing Combinational Logic 8 Lecture 22: Implementing ombinational Logic S 5 L22 James. Hoe Dept of EE, MU April 9, 25 Today s Goal: Design some combinational logic circuits Announcements: Read Rizzoni 2.4 and 2.5 HW 8 due today

More information

Lecture 10: Floating Point, Digital Design

Lecture 10: Floating Point, Digital Design Lecture 10: Floating Point, Digital Design Today s topics: FP arithmetic Intro to Boolean functions 1 Examples Final representation: (-1) S x (1 + Fraction) x 2 (Exponent Bias) Represent -0.75 ten in single

More information

Binary Adders: Half Adders and Full Adders

Binary Adders: Half Adders and Full Adders Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order

More information

CSE 373: Data Structures and Algorithms

CSE 373: Data Structures and Algorithms CSE 373: Data Structures and Algorithms Lecture 4: Asymptotic Analysis part 3 Code Style, Recurrence Relations, Formal Big-O & Cousins Instructor: Lilian de Greef Quarter: Summer 2017 Today: Code Style

More information

How a Digital Binary Adder Operates

How a Digital Binary Adder Operates Overview of a Binary Adder How a Digital Binary Adder Operates By: Shawn R Moser A binary adder is a digital electronic component that is used to perform the addition of two binary numbers and return the

More information

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

CSE 201 JAVA PROGRAMMING I. Copyright 2016 by Smart Coding School CSE 201 JAVA PROGRAMMING I Primitive Data Type Primitive Data Type 8-bit signed Two s complement Integer -128 ~ 127 Primitive Data Type 16-bit signed Two s complement Integer -32768 ~ 32767 Primitive Data

More information

CSE 20 Discrete Mathematics

CSE 20 Discrete Mathematics CSE 20 Discrete Mathematics Instructor CK Cheng, CSE2130 ckcheng+20@ucsd.edu, tel: 858 534-6184 Teaching Assistants Jingwei Lu E-mail: jlu@cs.ucsd.edu Office Hours: TBA Rossana Motta E-mail: rmotta@cs.ucsd.edu

More information

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

COSC 243. Data Representation 3. Lecture 3 - Data Representation 3 1. COSC 243 (Computer Architecture) COSC 243 Data Representation 3 Lecture 3 - Data Representation 3 1 Data Representation Test Material Lectures 1, 2, and 3 Tutorials 1b, 2a, and 2b During Tutorial a Next Week 12 th and 13 th March If you

More information

CS1800 Discrete Structures Final Version A

CS1800 Discrete Structures Final Version A CS1800 Discrete Structures Fall 2017 Profs. Aslam, Gold, & Pavlu December 11, 2017 CS1800 Discrete Structures Final Version A Instructions: 1. The exam is closed book and closed notes. You may not use

More information

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

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,... Chapter 9 Computer Arithmetic Reading: Section 9.1 on pp. 290-296 Computer Representation of Data Groups of two-state devices are used to represent data in a computer. In general, we say the states are

More information

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

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation Complement Number Systems A complement number system is used to represent positive and negative integers A complement number system is based on a fixed length representation of numbers Pretend that integers

More information

Lecture 2. Variables & Assignment

Lecture 2. Variables & Assignment Lecture 2 Variables & Assignment Announcements for Today If Not Done Already Enroll in Piazza Sign into CMS Fill out the Survey Complete AI Quiz Read the tetbook Chapter 1 (browse) Chapter 2 (in detail)

More information

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

CMPSCI 250: Introduction to Computation. Lecture #1: Things, Sets and Strings David Mix Barrington 22 January 2014 CMPSCI 250: Introduction to Computation Lecture #1: Things, Sets and Strings David Mix Barrington 22 January 2014 Things, Sets, and Strings The Mathematical Method Administrative Stuff The Objects of Mathematics

More information

Programming in C++ PART 2

Programming in C++ PART 2 Lecture 07-2 Programming in C++ PART 2 By Assistant Professor Dr. Ali Kattan 1 The while Loop and do..while loop In the previous lecture we studied the for Loop in C++. In this lecture we will cover iteration

More information

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall CSE 20 https://goo.gl/forms/1o 1KOd17RMoURxjn2 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Explain the steps in a proof by mathematical and/or structural

More information

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

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers Chapter 03: Computer Arithmetic Lesson 09: Arithmetic using floating point numbers Objective To understand arithmetic operations in case of floating point numbers 2 Multiplication of Floating Point Numbers

More information

Integers II. CSE 351 Autumn 2018

Integers II. CSE 351 Autumn 2018 Integers II CSE 351 Autumn 2018 Instructor: Teaching Assistants: Justin Hsia Akshat Aggarwal An Wang Andrew Hu Brian Dai Britt Henderson James Shin Kevin Bi Kory Watson Riley Germundson Sophie Tian Teagan

More information

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

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 Course Name: Advanced Java Lecture 2 Topics to be covered Variables Operators Variables -Introduction A variables can be considered as a name given to the location in memory where values are stored. One

More information

CS 327E Class 3. February 11, 2019

CS 327E Class 3. February 11, 2019 CS 327E Class 3 February 11, 2019 1) A join is used to concatenate rows from two tables that are related via referential integrity. For example, joining T and U on T.b and U.b produces V when projecting

More information

Values, Variables, Types & Arithmetic Expressions. Agenda

Values, Variables, Types & Arithmetic Expressions. Agenda Values, Variables, Types & Arithmetic Expressions Lecture 2 Object-Oriented Programming Agenda Inside of a Computer Value Variable Data Types in Java Literals Identifiers Type conversions Manipulating

More information

Computer Systems C S Cynthia Lee

Computer Systems C S Cynthia Lee Computer Systems C S 1 0 7 Cynthia Lee 2 Today s Topics LECTURE: Floating point! Real Numbers and Approximation MATH TIME! Some preliminary observations on approximation We know that some non-integer numbers

More information

CSE 20 DISCRETE MATH WINTER

CSE 20 DISCRETE MATH WINTER CSE 20 DISCRETE MATH WINTER 2016 http://cseweb.ucsd.edu/classes/wi16/cse20-ab/ Today's learning goals Explain the steps in a proof by (strong) mathematical induction Use (strong) mathematical induction

More information

ENGR 102 Engineering Lab I - Computation

ENGR 102 Engineering Lab I - Computation ENGR 102 Engineering Lab I - Computation Week 03: Data Types and Console Input / Output Introduction to Types As we have already seen, 1 computers store numbers in a binary sequence of bits. The organization

More information

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

CSE548, AMS542: Analysis of Algorithms, Fall 2012 Date: October 16. In-Class Midterm. ( 11:35 AM 12:50 PM : 75 Minutes ) CSE548, AMS542: Analysis of Algorithms, Fall 2012 Date: October 16 In-Class Midterm ( 11:35 AM 12:50 PM : 75 Minutes ) This exam will account for either 15% or 30% of your overall grade depending on your

More information

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

Student Number: UTORid: Question 0. [1 mark] Read and follow all instructions on this page, and fill in all fields. CSC 258H1 Y 2016 Midterm Test Duration 1 hour and 50 minutes Aids allowed: none Student Number: UTORid: Last Name: First Name: Question 0. [1 mark] Read and follow all instructions on this page, and fill

More information

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

SYNERGY INSTITUTE OF ENGINEERING & TECHNOLOGY,DHENKANAL LECTURE NOTES ON DIGITAL ELECTRONICS CIRCUIT(SUBJECT CODE:PCEC4202) Lecture No:5 Boolean Expressions and Definitions Boolean Algebra Boolean Algebra is used to analyze and simplify the digital (logic) circuits. It uses only the binary numbers i.e. 0 and 1. It is also called

More information

Visual Basic for Applications

Visual Basic for Applications Visual Basic for Applications Programming Damiano SOMENZI School of Economics and Management Advanced Computer Skills damiano.somenzi@unibz.it Week 1 Outline 1 Visual Basic for Applications Programming

More information

CS4800: Algorithms & Data Jonathan Ullman

CS4800: Algorithms & Data Jonathan Ullman CS4800: Algorithms & Data Jonathan Ullman Lecture 13: Shortest Paths: Dijkstra s Algorithm, Heaps DFS(?) Feb 0, 018 Navigation s 9 15 14 5 6 3 18 30 11 5 0 16 4 6 6 3 19 t Weighted Graphs A graph with

More information

Lecture (03) Binary Codes Registers and Logic Gates

Lecture (03) Binary Codes Registers and Logic Gates Lecture (03) Binary Codes Registers and Logic Gates By: Dr. Ahmed ElShafee Binary Codes Digital systems use signals that have two distinct values and circuit elements that have two stable states. binary

More information

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

CS 101 Computer Programming and utilization. Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal Rekhi Building IIT Bombay CS 101 Computer Programming and utilization Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal Rekhi Building Bombay Lecture 4, Conditional execution of instructions Friday, August

More information

Information Science 1

Information Science 1 Information Science Boolean Expressions Week College of Information Science and Engineering Ritsumeikan University Topics covered l Terms and concepts from Week 9 l Binary (Boolean) logic History Boolean

More information

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

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators) Name: Email address: Quiz Section: CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators) Instructions: Read the directions for each question carefully before answering. We will

More information

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

CMPSCI 250: Introduction to Computation. Lecture #14: Induction and Recursion (Still More Induction) David Mix Barrington 14 March 2013 CMPSCI 250: Introduction to Computation Lecture #14: Induction and Recursion (Still More Induction) David Mix Barrington 14 March 2013 Induction and Recursion Three Rules for Recursive Algorithms Proving

More information

CMSC201 Computer Science I for Majors

CMSC201 Computer Science I for Majors CMSC201 Computer Science I for Majors Lecture 03 Operators All materials copyright UMBC and Dr. Katherine Gibson unless otherwise noted Variables Last Class We Covered Rules for naming Different types

More information

Von Neumann Architecture

Von Neumann Architecture Von Neumann Architecture Assist lecturer Donya A. Khalid Lecture 2 2/29/27 Computer Organization Introduction In 945, just after the World War, Jon Von Neumann proposed to build a more flexible computer.

More information

Information Science 1

Information Science 1 Information Science 1 - Representa*on of Data in Memory- Week 03 College of Information Science and Engineering Ritsumeikan University Topics covered l Basic terms and concepts of The Structure of a Computer

More information

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

UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis UCSD CSE 21, Spring 2014 [Section B00] Mathematics for Algorithm and System Analysis Lecture 11 Class URL: http://vlsicad.ucsd.edu/courses/cse21-s14/ Lecture 11 Notes Goals for this week (Tuesday) Linearity

More information

Standard Boolean Forms

Standard Boolean Forms Standard Boolean Forms In this section, we develop the idea of standard forms of Boolean expressions. In part, these forms are based on some standard Boolean simplification rules. Standard forms are either

More information

Inf2C - Computer Systems Lecture 2 Data Representation

Inf2C - Computer Systems Lecture 2 Data Representation Inf2C - Computer Systems Lecture 2 Data Representation Boris Grot School of Informatics University of Edinburgh Last lecture Moore s law Types of computer systems Computer components Computer system stack

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

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

Summary of Lecture 4. Computer Programming: Skills & Concepts (INF-1-CP1) Variables; scanf; Conditional Execution. Tutorials. Summary of Lecture 4 Computer Programming: Skills & Concepts (INF-1-CP1) Variables; scanf; Conditional Execution Integer arithmetic in C. Converting pre-decimal money to decimal. The int type and its operators.

More information

Lecture 1. Course Overview Types & Expressions

Lecture 1. Course Overview Types & Expressions Lecture 1 Course Overview Types & Expressions CS 1110 Spring 2012: Walker White Outcomes: Basics of (Java) procedural programming Usage of assignments, conditionals, and loops. Ability to write recursive

More information

Integers II. CSE 351 Autumn Instructor: Justin Hsia

Integers II. CSE 351 Autumn Instructor: Justin Hsia Integers II CSE 351 Autumn 2017 Instructor: Justin Hsia Teaching Assistants: Lucas Wotton Michael Zhang Parker DeWilde Ryan Wong Sam Gehman Sam Wolfson Savanna Yee Vinny Palaniappan http://xkcd.com/557/

More information

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

COMP Primitive and Class Types. Yi Hong May 14, 2015 COMP 110-001 Primitive and Class Types Yi Hong May 14, 2015 Review What are the two major parts of an object? What is the relationship between class and object? Design a simple class for Student How to

More information

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

Today. Types of graphs. Complete Graphs. Trees. Hypercubes. Today. Types of graphs. Complete Graphs. Trees. Hypercubes. Complete Graph. K n complete graph on n vertices. All edges are present. Everyone is my neighbor. Each vertex is adjacent to every other vertex.

More information

The. Binary. Number System

The. Binary. Number System The Binary Number System Why is Binary important? Everything on a computer (or other digital device) is represented by Binary Numbers One to Five in various systems 1 2 3 4 5 I II III IV V 1 10 11 100

More information

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

Outline. Review of Last Week II. Review of Last Week. Computer Memory. Review Variables and Memory. February 7, Data Types Data Types Declarations and Initializations Larry Caretto Computer Science 16 Computing in Engineering and Science February 7, 25 Outline Review last week Meaning of data types Integer data types have

More information

IST 4 Information and Logic

IST 4 Information and Logic IST 4 Information and Logic T = today x= hw#x out x= hw#x due mon tue wed thr 28 M oh 4 oh M oh oh 2 M2 8 oh oh 2 fri oh oh = office hours oh 25 oh M2 2 3 oh T midterms oh Mx= MQx out 9 oh 3 4 oh Mx= MQx

More information

Lecture 2: Variables & Assignments

Lecture 2: Variables & Assignments http://www.cs.cornell.edu/courses/cs1110/2018sp Lecture 2: Variables & Assignments (Sections 2.1-2.3,2.5) CS 1110 Introduction to Computing Using Python [E. Andersen, A. Bracy, D. Gries, L. Lee, S. Marschner,

More information

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

CSE 351: The Hardware/Software Interface. Section 2 Integer representations, two s complement, and bitwise operators CSE 351: The Hardware/Software Interface Section 2 Integer representations, two s complement, and bitwise operators Integer representations In addition to decimal notation, it s important to be able to

More information

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

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning 4 Operations On Data 4.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three categories of operations performed on data.

More information

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

FLIPPED CLASS F#3- Number System. Department of CSE, Coimbatore CTPS 2018 FLIPPED CLASS F#3- Number System Department of CSE, Coimbatore CTPS 2018 1 Common Number Systems System Base Symbols Used by humans? Used in computers? Decimal 10 0, 1, 9 Yes No Binary 2 0, 1 No Yes Octal

More information

CSE 21: Mathematics for Algorithms and Systems Analysis

CSE 21: Mathematics for Algorithms and Systems Analysis CSE 21: Mathematics for Algorithms and Systems Analysis Week 10 Discussion David Lisuk June 4, 2014 David Lisuk CSE 21: Mathematics for Algorithms and Systems Analysis June 4, 2014 1 / 26 Agenda 1 Announcements

More information

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

Lecture 3: Binary Subtraction, Switching Algebra, Gates, and Algebraic Expressions EE210: Switching Systems Lecture 3: Binary Subtraction, Switching Algebra, Gates, and Algebraic Expressions Prof. YingLi Tian Feb. 5/7, 2019 Department of Electrical Engineering The City College of New

More information

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

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq CS 121 Digital Logic Design Chapter 1 Teacher Assistant Hadeel Al-Ateeq Announcement DON T forgot to SIGN your schedule OR you will not be allowed to attend next lecture. Communication Office hours (8

More information

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

(Type your answer in radians. Round to the nearest hundredth as needed.) 1. Find the exact value of the following expression within the interval (Simplify your answer. Type an exact answer, using as needed. Use integers or fractions for any numbers in the expression. Type N

More information

CSE 143 Lecture 11. Decimal Numbers

CSE 143 Lecture 11. Decimal Numbers CSE 143 Lecture 11 Recursive Programming slides created by Marty Stepp http://www.cs.washington.edu/143/ Decimal Numbers A visual review of decimal numbers: We get 348 by adding powers of 10 348 = 300

More information

Department of Computer Science Purdue University, West Lafayette

Department of Computer Science Purdue University, West Lafayette Department of Computer Science Purdue University, West Lafayette Fall 2011: CS 180 Problem Solving and OO Programming Exam 1 Solutions Q 1 Answer the questions below assuming that binary integers are represented

More information

Lecture (04) Boolean Algebra and Logic Gates

Lecture (04) Boolean Algebra and Logic Gates Lecture (4) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee ١ Dr. Ahmed ElShafee, ACU : Spring 26, Logic Design Boolean algebra properties basic assumptions and properties: Closure law A set S is

More information

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

Lecture (04) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee Lecture (4) Boolean Algebra and Logic Gates By: Dr. Ahmed ElShafee Boolean algebra properties basic assumptions and properties: Closure law A set S is closed with respect to a binary operator, for every

More information

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

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Invitation to Computer Science, C++ Version, Third Edition Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition Objectives In this chapter, you will learn about: The binary numbering

More information

Complexity and Advanced Algorithms Monsoon Parallel Algorithms Lecture 2

Complexity and Advanced Algorithms Monsoon Parallel Algorithms Lecture 2 Complexity and Advanced Algorithms Monsoon 2011 Parallel Algorithms Lecture 2 Trivia ISRO has a new supercomputer rated at 220 Tflops Can be extended to Pflops. Consumes only 150 KW of power. LINPACK is

More information

Boolean Analysis of Logic Circuits

Boolean Analysis of Logic Circuits Course: B.Sc. Applied Physical Science (Computer Science) Year & Sem.: IInd Year, Sem - IIIrd Subject: Computer Science Paper No.: IX Paper Title: Computer System Architecture Lecture No.: 7 Lecture Title:

More information

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

Outline for Today CSE 142. CSE142 Wi03 G-1. withdraw Method for BankAccount. Class Invariants CSE 142 Outline for Today Conditional statements if Boolean expressions Comparisons (=,!=, ==) Boolean operators (and, or, not - &&,,!) Class invariants Conditional Statements & Boolean Expressions

More information

An Annotated Language

An Annotated Language Hoare Logic An Annotated Language State and Semantics Expressions are interpreted as functions from states to the corresponding domain of interpretation Operators have the obvious interpretation Free of

More information

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

INF2270 Spring Philipp Häfliger. Lecture 4: Signed Binaries and Arithmetic INF2270 Spring 2010 Philipp Häfliger Lecture 4: Signed Binaries and Arithmetic content Karnaugh maps revisited Binary Addition Signed Binary Numbers Binary Subtraction Arithmetic Right-Shift and Bit Number

More information

CS/COE 0447 Example Problems for Exam 2 Spring 2011

CS/COE 0447 Example Problems for Exam 2 Spring 2011 CS/COE 0447 Example Problems for Exam 2 Spring 2011 1) Show the steps to multiply the 4-bit numbers 3 and 5 with the fast shift-add multipler. Use the table below. List the multiplicand (M) and product

More information

CMPE223/CMSE222 Digital Logic Design. Positional representation

CMPE223/CMSE222 Digital Logic Design. Positional representation CMPE223/CMSE222 Digital Logic Design Number Representation and Arithmetic Circuits: Number Representation and Unsigned Addition Positional representation First consider integers Begin with positive only

More information

Lecture 10: Floating Point, Digital Design

Lecture 10: Floating Point, Digital Design Lecture 10: Floating Point, Digital Design Today s topics: FP arithmetic Intro to Boolean functions 1 Examples Final representation: (-1) S x (1 + Fraction) x 2 (Exponent Bias) Represent -0.75 ten in single

More information

Review Functions. Natural Language and Dialogue Systems Lab

Review Functions. Natural Language and Dialogue Systems Lab Review Functions Natural Language and Dialogue Systems Lab Announcements Today: Guest Lecture on Human Computer Interaction and Design for Special Populations by Prof. Sri Kurniawan Co-Director of the

More information

CPSC 121: Models of Computation

CPSC 121: Models of Computation Instructor: Bob Woodham woodham@cs.ubc.ca Department of Computer Science University of British Columbia Lecture Notes 2009/2010, Section 203 Menu March 22, 2010 Topics: A Simple Computer High-level design

More information

CSE 417 Network Flows (pt 4) Min Cost Flows

CSE 417 Network Flows (pt 4) Min Cost Flows CSE 417 Network Flows (pt 4) Min Cost Flows Reminders > HW6 is due Monday Review of last three lectures > Defined the maximum flow problem find the feasible flow of maximum value flow is feasible if it

More information

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

Recap from Last Time. CSE 2021: Computer Organization. It s All about Numbers! 5/12/2011. Text Pictures Video clips Audio CSE 2021: Computer Organization Recap from Last Time load from disk High-Level Program Lecture-2(a) Data Translation Binary patterns, signed and unsigned integers Today s topic Data Translation Code Translation

More information

Lecture 5: More Examples/Applications of Quasirandom Graphs

Lecture 5: More Examples/Applications of Quasirandom Graphs Random and Quasirandom Graphs Instructor: Padraic Bartlett Lecture 5: More Examples/Applications of Quasirandom Graphs Week 4 Mathcamp 2012 In our last class, we saw that the Paley graphs were an example

More information

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

DIGITAL CIRCUIT LOGIC UNIT 7: MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES DIGITAL CIRCUIT LOGIC UNIT 7: MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES 1 iclicker Question 13 Considering the K-Map, f can be simplified as (2 minutes): A) f = b c + a b c B) f = ab d + a b d AB CD

More information

CSE303 Logic Design II Laboratory 01

CSE303 Logic Design II Laboratory 01 CSE303 Logic Design II Laboratory 01 # Student ID Student Name Grade (10) 1 Instructor signature 2 3 4 5 Delivery Date -1 / 15 - Experiment 01 (Half adder) Objectives In the first experiment, a half adder

More information

Lecture 1. Course Overview, Python Basics

Lecture 1. Course Overview, Python Basics Lecture 1 Course Overview, Python Basics We Are Very Full! Lectures and Labs are at fire-code capacity We cannot add sections or seats to lectures You may have to wait until someone drops No auditors are

More information

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

CSC 120 Computer Science for the Sciences. Week 1 Lecture 2. UofT St. George January 11, 2016 CSC 120 Computer Science for the Sciences Week 1 Lecture 2 UofT St. George January 11, 2016 Introduction to Python & Foundations of computer Programming Variables, DataTypes, Arithmetic Expressions Functions

More information

Decimals Outcomes. Represent Q Using Decomposition

Decimals Outcomes. Represent Q Using Decomposition 1 Decimals Outcomes Represent addition, subtraction, multiplication, and division in Q using number lines and decomposition. Perform addition, subtraction, multiplication, and division in Q. Convert between

More information

Lecture: Analysis of Algorithms (CS )

Lecture: Analysis of Algorithms (CS ) Lecture: Analysis of Algorithms (CS483-001) Amarda Shehu Spring 2017 1 The Fractional Knapsack Problem Huffman Coding 2 Sample Problems to Illustrate The Fractional Knapsack Problem Variable-length (Huffman)

More information

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

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning 4 Operations On Data 4.1 Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: List the three categories of operations performed on data.

More information

Chapter 4. Operations on Data

Chapter 4. Operations on Data Chapter 4 Operations on Data 1 OBJECTIVES After reading this chapter, the reader should be able to: List the three categories of operations performed on data. Perform unary and binary logic operations

More information

Digital Circuits ECS 371

Digital Circuits ECS 371 Digital Circuits ECS 37 Dr. Prapun Suksompong prapun@siit.tu.ac.th Lecture 7 Office Hours: KD 36-7 Monday 9:-:3, :3-3:3 Tuesday :3-:3 Announcement HW2 posted on the course web site Chapter 4: Write down

More information

EE292: Fundamentals of ECE

EE292: Fundamentals of ECE EE292: Fundamentals of ECE Fall 2012 TTh 10:00-11:15 SEB 1242 Lecture 22 121115 http://www.ee.unlv.edu/~b1morris/ee292/ 2 Outline Review Binary Number Representation Binary Arithmetic Combinatorial Logic

More information

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

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 4 Notes. Class URL: Notes slides from before lecture CSE 21, Winter 2017, Section A00 Lecture 4 Notes Class URL: http://vlsicad.ucsd.edu/courses/cse21-w17/ Notes slides from before lecture Notes January 23 (1) HW2 due tomorrow

More information

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

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN SUBJECT: CSE 2.1.6 DIGITAL LOGIC DESIGN CLASS: 2/4 B.Tech., I SEMESTER, A.Y.2017-18 INSTRUCTOR: Sri A.M.K.KANNA

More information

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

CSE 452: Programming Languages. Outline of Today s Lecture. Expressions. Expressions and Control Flow CSE 452: Programming Languages Expressions and Control Flow Outline of Today s Lecture Expressions and Assignment Statements Arithmetic Expressions Overloaded Operators Type Conversions Relational and

More information

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

COMP 250: Java Programming I. Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette COMP 250: Java Programming I Carlos G. Oliver, Jérôme Waldispühl January 17-18, 2018 Slides adapted from M. Blanchette Variables and types [Downey Ch 2] Variable: temporary storage location in memory.

More information

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS Chapter 1. 1.1. INTRODUCTION Digital computers have brought about the information age that we live in today. Computers are important tools because they can locate and process enormous amounts of information

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information