Chapter 2 Guobao Jiang Outline 2.1 Information Storage 2.2 Integer Representations 2.3 Integer Arithmetic 2.4 Floating Point.

Slides:



Advertisements
Similar presentations
Chapter 4: Control Structures I (Selection)
Advertisements

Pemrograman Dasar - Data Types1 OPERATOR. Pemrograman Dasar - Data Types2 Arithmetic operator  + - * /  / operator denotes integer division if both.
Sample Test 1 Question. A pattern of binary digits can be interpreted in several different ways. Show how the pattern translates using each of.
Boolean Algebra Lecture 7: Supporting Material Dr Kathryn Merrick Tuesday 24 th March, 2009.
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
1 9/24/07CS150 Introduction to Computer Science 1 Relational Operators and the If Statement.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
2-1 Making Decisions Sample assignment statements PayAmount = Hours * Rate PayAmount = 40*Rate + (Hours – 40)*Rate*1.5.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Introduction.
1 CS150 Introduction to Computer Science 1 Relational Operators and the If Statement 9/22/08.
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
Data Types. Every program must deal with data The data is usually described as a certain type This type determines what you can do with the data and how.
Operations on data CHAPTER 4.
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic.
Chapter 1 Number Systems and Codes 1. Outline 1. NUMBER SYSTEMS AND CODES 2. DIGITAL ELECTRONIC SIGNALS AND SWITCHES 3. BASIC LOGIC GATES 4. PROGRAMMABLE.
Computer Science 101 The Boolean System. George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.
Binary Numbers.
Lecture # 5 Data Representation. Today Questions: From notes/reading/life? Prepare for Quiz # 1 (Multiple Choice) 1.Introduce: How do Computers store.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 3A Integral Data (Concepts)
Number systems Jaana Holvikivi Metropolia. Result AND OR NOT Logical operations Boolean algebra Operations &&AND.
Chapter 2 Bits, Data Types, and Operations. 2-2 Hexadecimal Notation It is often convenient to write binary (base-2) numbers as hexadecimal (base-16)
Windows Programming, C.-S. Shieh, KUAS EC, Chapter 3 Operators and Expressions.
1 Saint Louis University Arithmetic and Bitwise Operations on Binary Data CSCI 224 / ECE 317: Computer Architecture Instructor: Prof. Jason Fritts Slides.
التحليل والتصميم المنطقي DIGITAL DESIGN Instructor : Khalil Alsulbi Mobile : Room : 217.
C Operators. CONTENTS C OPERATORS TYPES OF OPERATOR UNARY BINARY TERNARY ARITHMATIC RELATIONAL LOGICAL.
1 © 2002 John Urrutia. All rights reserved. Qbasic Chapter 4 IF Statements and READ & DATA.
Chapter 1  Number Systems Decimal System Binary System Octal System Hexadecimal System  Binary weighted cods Signed number binary order  1’s and 2’s.
Digital Systems and Binary Numbers
Lecture 1: Construction & Extension: Story of Numbers Addressed by Z.Liu.
Programming with Visual C++: Concepts and Projects Chapter 3A: Integral Data (Concepts)
Chapter 51 Logical Operators Used with Boolean expressions Not – makes a False expression True and vice versa And – will yield a True if and only if both.
Chapter 4 Making Decision Csc 125 C++ programming language Fall 2005.
Bits and Bytes Boolean Algebra ( ) Boolean algebra Expressing in C.
Visual Basic CDA College Limassol Campus COM123 Visual Basic Programming Semester C Lecture:Pelekanou Olga Week 4: Understand and implement Decisions.
DIGITAL LOGIC DESIGN TOPIC: NUMBER SYSTEMS OPERATIONS AND CODES:
Department of Electronic & Electrical Engineering Expressions operators operands precedence associativity types.
Sum of Arithmetic Sequences. Definitions Sequence Series.
Operators A binary operator combines two values to get one result: x OP y where OP is any binary operators such as +, -, *, /, ==, !=, >, &&, or even =.
1 Manipulating Information (1). 2 Outline Bit-level operations Suggested reading –2.1.7~
Chapter 5 NUMBER REPRESENTATION AND ARITHMETIC CIRCUITS.
Relational Operator and Operations
Digital Systems and Binary Numbers
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Bits, Bytes, and Integers CSE 238/2038/2138: Systems Programming
Instructor: David Ferry
Digital Systems and Binary Numbers
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
4-1 LOGIC OPERATIONS In Chapter 3 we discussed the fact that data inside a computer is stored as patterns of bits. Logic operations refer to those operations.
Variable Declarations, Data types, Expressions
2-1 Making Decisions Sample assignment statements
Introduction to Abstract Data Types
Bools and simple if statements
Relational Operators Operator Meaning < Less than > Greater than
Modular Arithmetic and Change of Base
Bits and Bytes Boolean algebra Expressing in C
Computer Science 210 Computer Organization
Bits, Bytes, and Integers 2nd Lectures
Chapter 8: More on the Repetition Structure
Digital Logic Design (CSNB163)
Adders.
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Expressions.
Comp Org & Assembly Lang
Comp Org & Assembly Lang
CHAPTER 3 Logic.
Lecture 2: Bits, Bytes, Ints
If there is any case in which true premises lead to a false conclusion, the argument is invalid. Therefore this argument is INVALID.
If there is any case in which true premises lead to a false conclusion, the argument is invalid. Therefore this argument is INVALID.
Conditionals.
Presentation transcript:

Chapter 2 Guobao Jiang

Outline 2.1 Information Storage 2.2 Integer Representations 2.3 Integer Arithmetic 2.4 Floating Point 2.5 Summary 2

2.1 Information Storage Problem 2.1 (P29) A. 0x8F7A93 to binary3 8 F 7 A D. Binary to hexadecimal B 7 E 6 3

4

Boolean Algebras and Rings Ring (Integer ring, Modular arithmetic) Boolean algebra Note :the operations are different! 5

Logical Operations and Bit-level Operations P49 LO: 1) nonzero argument as TRUE, 0 as FALSE 2) logical operators do not evaluate their second argument if what? 6