1 Carnegie Mellon Welcome to recitation! 15-213: Introduction to Computer Systems 3 rd Recitation, Sept. 10, 2012 Instructor: Adrian Trejo (atrejo) Section.

Slides:



Advertisements
Similar presentations
Intro to Computer Systems Recitation #1 By sseshadr.
Advertisements

Carnegie Mellon Instructors: Randy Bryant & Dave O’Hallaron Floating Point : Introduction to Computer Systems 3 rd Lecture, Aug. 31, 2010.
Socratic Method, Understanding Floats. Float Cheat Sheet ExponentSignificandValue 000 0nonzeroDenorm 1~ 2 E - 2Anything+/- fl. Pt # 2 E - 1 (all 1s)0+/-
15213 Recitation Fall 2014 Section A, 8 th September Vinay Bhat.
Floating Point Numbers
Carnegie Mellon Floating Point : Introduction to Computer Systems – Recitation January 24, 2011.
Floating Point Numbers
Floating Point Numbers. CMPE12cGabriel Hugh Elkaim 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or.
Computer ArchitectureFall 2007 © September 5, 2007 Karem Sakallah CS 447 – Computer Architecture.
Floating Point Numbers. CMPE12cCyrus Bazeghi 2 Floating Point Numbers Registers for real numbers usually contain 32 or 64 bits, allowing 2 32 or 2 64.
Number Systems Standard positional representation of numbers:
1 Lecture 3 Bit Operations Floating Point – 32 bits or 64 bits 1.
1  2004 Morgan Kaufmann Publishers Chapter Three.
Recitation # Section F Spring 2006 Jernej Barbic.
Computer ArchitectureFall 2008 © August 27, CS 447 – Computer Architecture Lecture 4 Computer Arithmetic (2)
Lecture 8 Floating point format
IEEE Floating Point Numbers Overview Noah Mendelsohn Tufts University Web: COMP.
Simple Data Type Representation and conversion of numbers
IT 251 Computer Organization and Architecture Introduction to Floating Point Numbers Chia-Chi Teng.
Computer Arithmetic. Instruction Formats Layout of bits in an instruction Includes opcode Includes (implicit or explicit) operand(s) Usually more than.
Review CAS CS210 Ying Ye Boston University. Logical expressions Truth table input: A, B, Coutput: D ABCD (~A)(~B)(~C)
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Information Representation: Negative and Floating Point.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
Number Systems So far we have studied the following integer number systems in computer Unsigned numbers Sign/magnitude numbers Two’s complement numbers.
Floating Point Numbers Topics –IEEE Floating Point Standard –Rounding –Floating Point Operations –Mathematical properties.
Floating Point Representations CDA 3101 Discussion Session 02.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Carnegie Mellon 1 Representing Data : Introduction to Computer Systems Recitation 3: Monday, Sept. 9 th, 2013 Marjorie Carlson Section A.
ITEC 1011 Introduction to Information Technologies 4. Floating Point Numbers Chapt. 5.
Integer and Fixed Point P & H: Chapter 3
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: November 08, 2004 Lecture Number: 30.
15213 Recitation Section C Introduction Unix and C Playing with Bits Practice Problems Shimin Chen Sept. 9, 2002 Outline.
Carnegie Mellon 1 Midterm Review : Introduction to Computer Systems Recitation 8: Monday, Oct. 19, 2015 Ben Spinelli.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
Data Representation : Introduction to Computer Systems Recitation 2: Monday, Jan. 29th, 2015 Dhruven Shah.
Carnegie Mellon 1 Midterm Review : Introduction to Computer Systems Recitation 8: Monday, Oct. 14, 2013 Marjorie Carlson Section A.
순천향대학교 정보기술공학부 이 상 정 1 3. Arithmetic for Computers.
Numbers in Computers.
Carnegie Mellon 1 Midterm Review : Introduction to Computer Systems Recitation 8: Monday, Oct. 13, 2014 Lou Clark.
COMPUTER SCIENCE Data Representation and Machine Concepts Section 1.7 Instructor: Lin Chen Sept 2013.
10/7/2004Comp 120 Fall October 7 Read 5.1 through 5.3 Register! Questions? Chapter 4 – Floating Point.
Carnegie Mellon Midterm Review : Introduction to Computer Systems October 15, 2012 Instructor:
Fixed-point and floating-point numbers Ellen Spertus MCS 111 October 4, 2001.
Floating Point Arithmetic – Part I
CSCI206 - Computer Organization & Programming
2.4. Floating Point Numbers
CSCI206 - Computer Organization & Programming
PRESENTED BY J.SARAVANAN. Introduction: Objective: To provide hardware support for floating point arithmetic. To understand how to represent floating.
S09 Recitation #1 Jernej Barbic (S06) Revised: Alex Gartrell (S09)
Topic 3d Representation of Real Numbers
Luddy Harrison CS433G Spring 2007
CSCI206 - Computer Organization & Programming
Number Representations
CS201 - Lecture 5 Floating Point
CSCI206 - Computer Organization & Programming
Recitation 5 – 2/19/01 Outline
COMS 161 Introduction to Computing
Topic 3d Representation of Real Numbers
Number Representations
Presentation transcript:

1 Carnegie Mellon Welcome to recitation! : Introduction to Computer Systems 3 rd Recitation, Sept. 10, 2012 Instructor: Adrian Trejo (atrejo) Section H, 3:30p – 4:30p WEH5302

2 Outline General UNIX Integers IEEE Floating Point Datalab Tips Style Cheating Summary Carnegie Mellon

3 General Stuff Everything related to the course can be found on these two sites. Carnegie Mellon

4 UNIX Basics In case you missed the boot camp: Use the shark machines! ssh/scp (on Mac/UNIX) PuTTY/Filezilla (on Windows) tar Learn to use an editor well (e.g. vim, emacs) and stick with it. Carnegie Mellon

5 Integers Signed vs. Unsigned Two’s complement representation Implicit casting between signed and unsigned Carnegie Mellon

6 Floating Point Sign (one bit) Exponent (single precision: 8 bits; double precision: 11 bits) Fraction (Mantissa) Bias (2^(k-1) – 1, where k is the number of exponent bit) Normalized (E = Exp – Bias) vs. Denormalized (E = 1 – Bias) Special Values (Exp is all ones) Carnegie Mellon

7 Floating Point (cont.) A favorite exam question: Carnegie Mellon

8 Datalab Tips Signed negation -x == ~x + 1 Always works except for x = Tmin Properties of Zero 0 & x = 0 for all x (0-1) & x = x for all x int x = 0 int y = -x x and y are both positive since their MSBs is 0 Carnegie Mellon

9 Parity Example Let’s write a function that takes an integer and returns 1 if it has an odd number of ‘1’ bits, and 0 otherwise. How can we get the answer? If we XOR all the bits together, then we’ll get the answer! (function should return 0) 1 ^ 0 ^ 0 ^ 1 ^ 1 ^ 0 ^ 1 ^ 0 = ^ 1010 = ^ 11 = 11 1 ^ 1 = 0 Carnegie Mellon

10 Style Make sure you read through it since we’ll use it as a rubric when we grade your labs. Look out for: Comments Magic numbers (without #define) Line length Consistency etc. Carnegie Mellon

11 Cheating policy Don’t do it! MOSS checker built into Autolab Carnegie Mellon

12 Need help? Office hours: UMTWH 5:30p – 8:30p WeH 5207 Recitation: bring us questions Carnegie Mellon