HW1 Report Xing Wang. HW1-PR1 Question Not Good Formatted Example.

Slides:



Advertisements
Similar presentations
Lesson 8 Expand and Simplify. Mathswatch 103
Advertisements

Please turn in your Home-learning, get your notebook and Springboard book, and begin the bell-ringer! Test on Activity 6, 7 and 8 Wednesday (A day) and.
Lecture 16: Computer Arithmetic Today’s topic –Floating point numbers –IEEE 754 representations –FP arithmetic Reminder –HW 4 due Monday 1.
Integers. Integer Storage Since Binary consists only of 0s and 1s, we can’t use a negative sign ( - ) for integers. Instead, the Most Significant Bit.
Chapter One Adding & Subtracting Integers. Adding Integers Key Concepts  Adding Integers with Same Sign  The sum of two positive integers is positive.
Example 1 Dividing Integers Same sign, so quotient is positive. 5 = a. 8 – 40 – b. 14 – 2 = 7 – Different signs, so quotient is negative. c. 9 – 36 = 4.
Introduction to C Programming Overview of C Hello World program Unix environment C programming basics.
Natural Numbers The Natural or counting numbers are denoted by N and are defined by:
2.1 Integers & Absolute Value 2.2 Adding Integers.
Two’s Complement 1.As an action: (Assume the starting value is 1011) 1.Flip the bits from the starting value => Add one to get the answer.
 Two Rules: 1. To add numbers with the same sign, ADD the absolute values and the answer has the same sign as the original numbers.  EXAMPLE:
IWBAT compare and order positive and negative numbers.
INTEGERS: adding, subtracting, multiplying, and dividing
Objective: Learn to multiply and divide integers.
Chapter 3 Data Representation part2 Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Integers. Adding integers Both positive…add as usual Both negative…add as usual and answer is negative Positive and negative…subtract…take the sign of.
Scientific Notation Section 8.5.
Section 8.5 Scientific Notation.
1 Arithmetic and Logical Operations - Part II. Unsigned Numbers Addition in unsigned numbers is the same regardless of the base. Given a pair of bit sequences.
Converting Fractions, Decimals, and Percents Fractions, decimals and percents can (with a few exceptions) be converted to any of the three formats. 50%
Representing Integer Data Book : Chapter ( Subject has no point !! ) A99ACF.
Computer Science 111 Fundamentals of Programming I Number Systems.
Warm- Up Use pgs. 199 and 200 in your workbook. Work on Hands on Activity 1 and 2.
Addition, Subtraction, Multiplication, and Division of Integers
Integer Operations. 1) What’s the rule for adding integers? *If both addends are Positive: - Add together and the sum is positive (Ex = 12) *If.
When we add or subtract integers we can use a number line to help us see what is happening with the numbers.
9.4 FLOATING-POINT REPRESENTATION
Question # 1 For $100 15$1,000,000 14$500,000 13$250,000 12$125,000 11$64,000 10$32,000 9$16,000 8$8,000 7$4,000 6$2,000 5$1,000 4$500 3$300 2$200 1$100.
Find the Square Root: 1) 3) 2) 4)
Physics Day 5 Objectives SWBAT do exponential math Understand factors of 10 Agenda Do Now Notes Worksheet HW2 due tonight HW3 Thursday.
ASCII and BCD Arithmetic Chapter 11 S. Dandamudi.
The Teacher CP4 Binary and all that… CP4 Revision.
3.3 Techniques of Differentiation Derivative of a Constant (page 191) The derivative of a constant function is 0.
10.4 Addition and Subtraction: Like Denominators Goal: to add and subtract rational expressions with like denominators.
Operations with Integers
Fractions to Decimals Remember that a decimal is a fractional number: it is a part of something whole. Do the following steps to convert a fraction to.
The Teacher CP4 Binary and all that… CP4 Revision.
Example 2 Adding Integers Find the sum – CHECK You can use a number line to check your answer –= 8 – Use sign of number with greater absolute.
Conditions : Perfect cube #’s ( 1, 8, 27, 64, 125, … ) Perfect cube exponents ( 3, 6, 9, 12,15, … ) Separated by a plus OR minus sign Factoring – Sum and.
Counting Coins. The Basics Quarter 25 cents Dime 10 cents.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
UNIT 2: GOVERNMENT FINANCE. FOREIGN EXCHANGE 2 decisions to make… 1) BUY or SELL? BE SURE YOU USE THE CORRECT COLUMN IN THE CHART! Is the bank SELLING.
Adding Integers When adding integers use SADS. If the signs are the same, add the numbers and take the sign of the largest absolute value. If the signs.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.6 Instructor: Lin Chen Sept 2013.
Review Adding Integers: (-5) = = (-7) = =
Unit 2: Integers Unit Review. Multiplying Integers The product of two integers with the same sign is a positive. Eg: (+6) x (+4) = +24; (-18) x (-3) =
Signed Rationals. What are signed rationals? Signed rationals are rational numbers with negative and positive signs. To solve signed rational problems:
B121 Chapter 5 Working with Numbers. Number representation ThousandHundredsTensUnits Natural numbers: 1,2,3,4,5……… Integers: Natural numbers.
Representing Integer Data
Bell Work: -3 x -6 = 5 x -6 = -7 x 2 = -9 x -8 = 8 x -5 = 4 x 8 =
Quick Review Find each sum: (-3) + (-3) + (-3) Answers:
Unit 1 Rational Numbers Integers.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Integer Operations Computer Organization and Assembly Language: Module 5.
Ch 3.1 Add and Subtract Signed Numbers Vocabulary Op posites :2 numbers the same distance from 0 but in opposite directions
Integer Review If you are combining two numbers with: SAME SIGNS YOU ADDTAKE THE SIGN OF THE LARGER NUMBER DIFFERENT SIGNS YOU SUBTRACT TAKE THE SIGN.
1  For recitations  Amr Mahmoud  Office Hours: Monday Benedum Hall.
CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH 2 Number Systems CPIT 201 Introduction.
1 Integer Representations V1.0 (22/10/2005). 2 Integer Representations  Unsigned integer  Signed integer  Sign and magnitude  Complements  One’s.
2.3 Output Formatting. Outputting Format Specify the number of spaces, “c”, used to print an integer value with specifier %cd, e.g., %3d, %4d. E.g. printf.
Representing Positive and Negative Numbers
Floating Point Representations
Expressions.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Integers: The set of counting numbers, their opposites and zero
1-8 Multiplying and Dividing Integers
Numbers representations
Module 10 Operations on Bits
2 4 −4 −2 −5 −3 −
Presentation transcript:

HW1 Report Xing Wang

HW1-PR1 Question

Not Good Formatted Example

Perfect Answer

HW1-PR2 your program should read an operand, an operator as a single character +-*/, and another operand, separated by spaces. Output the results. For example: – , output – 4 * 5, output 20

HW1-PR2 Test Cases InputOutput * 22 4 / 22 1 plus 22 1 minus 2 1 mul 22 4 div / 0Warning : Divided by 0 is invalid.

HW1-PR3 Exercise 11 on page 86, but with the following modifications: instead of using U.S. currency, write your program for the Euro. Note that Euro coins come in different denominations from U.S. coins; there are 8 that you must account for. Report to the user the individual counts (as in the original problem) and the sum in Euros and cents (instead of dollars and cents). In addition, convert the final value to U.S. dollars using a recent exchange rate (do not worry about rounding the result, for now).

HW1-PR3 Test Cases Cent 1Cent 2Cent 5Cent 10 Cent 20 Cent 50 Euro 1Euro 2Total Euro Total Dollar

HW1-PR4

HW1-PR4 Signed Integer Max Integer : 2,147,483, Min Integer : -2,147,483,648

The negative integer The absolute value of negative integer is the complementary of the binary representation plus Complementary of Absolute value of -1, Complementary of -1 plus 1

HW1-PR4-Analysis 1 10^10 ( )

HW1-PR4-Analysis 2 10^12, is a negative value as the sign bit is