Time (self-scheduled): Location Schedule Your Exam: What to bring:

Similar documents
Time: 8:30-10:00 pm (Arrive at 8:15 pm) Location What to bring:

COMP2611: Computer Organization. Data Representation

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Introduction to Computers and Programming. Numeric Values

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

The type of all data used in a C++ program must be specified

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

The type of all data used in a C (or C++) program must be specified

ECE232: Hardware Organization and Design

Chapter 3: Arithmetic for Computers

15213 Recitation 2: Floating Point

UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

COMP2121: Microprocessors and Interfacing. Number Systems

UNIT 7A Data Representation: Numbers and Text. Digital Data

Inf2C - Computer Systems Lecture 2 Data Representation

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

Midterm Exam Review Slides

CSCI 402: Computer Architectures. Arithmetic for Computers (3) Fengguang Song Department of Computer & Information Science IUPUI.

Chapter 3. Information Representation

Floating Point Arithmetic

Introduction to Computer Science-103. Midterm

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Floating-point Arithmetic. where you sum up the integer to the left of the decimal point and the fraction to the right.

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Review Topics. Midterm Exam Review Slides

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

3.5 Floating Point: Overview

Computer Systems C S Cynthia Lee

Chapter 4. Operations on Data

CS101 Lecture 04: Binary Arithmetic

M1 Computers and Data

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

Computer System and programming in C

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

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

More about Binary 9/6/2016

CS61c Midterm Review (fa06) Number representation and Floating points From your friendly reader

FLOATING POINT NUMBERS

BSM540 Basics of C Language

MACHINE LEVEL REPRESENTATION OF DATA

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Number Systems, Scalar Types, and Input and Output

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Chapter 10 Binary Arithmetics

Review Topics. Midterm Exam Review Slides

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Bits and Bytes and Numbers

CPS 104 Computer Organization and Programming Lecture-2 : Data representations,

Beginning C Programming for Engineers

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Numerical computing. How computers store real numbers and the problems that result

Objects and Types. COMS W1007 Introduction to Computer Science. Christopher Conway 29 May 2003

A Java program contains at least one class definition.

Computer Architecture Chapter 3. Fall 2005 Department of Computer Science Kent State University

Logic, Words, and Integers

l l l l l l l Base 2; each digit is 0 or 1 l Each bit in place i has value 2 i l Binary representation is used in computers

C NUMERIC FORMATS. Overview. IEEE Single-Precision Floating-point Data Format. Figure C-0. Table C-0. Listing C-0.

These are reserved words of the C language. For example int, float, if, else, for, while etc.

Floating Point Numbers

Floating Point Numbers

Module 2: Computer Arithmetic

Bits, Words, and Integers

Physics 306 Computing Lab 5: A Little Bit of This, A Little Bit of That

Data Representation 1

Integers and Floating Point

Number Systems. Both numbers are positive

CMPSCI 145 MIDTERM #1 Solution Key. SPRING 2017 March 3, 2017 Professor William T. Verts

COMP Overview of Tutorial #2

Data Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8

104 - Introduction to Computer Science - Midterm Exam

Floating Point Arithmetic

Numeric Encodings Prof. James L. Frankel Harvard University

Topic Notes: Bits and Bytes and Numbers

Variables and Data Representation

A Level Computing. Contents. For the Exam:

EE292: Fundamentals of ECE

Homework 1 graded and returned in class today. Solutions posted online. Request regrades by next class period. Question 10 treated as extra credit

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

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


CSCI 2212: Intermediate Programming / C Chapter 15

Under the Hood: Data Representation. Computer Science 104 Lecture 2

EE 109 Unit 19. IEEE 754 Floating Point Representation Floating Point Arithmetic

Co-processor Math Processor. Richa Upadhyay Prabhu. NMIMS s MPSTME February 9, 2016

Integer Representation Floating point Representation Other data types

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Topic Notes: Bits and Bytes and Numbers

ECE 331 Hardware Organization and Design. Professor Jay Taneja UMass ECE - Discussion 5 2/22/2018

Goals for this Week. CSC 2400: Computer Systems. Bits, Bytes and Data Types. Binary number system. Finite representations of binary integers

Lec-6-HW-3-ALUarithmetic-SOLN

Chapter 4: Data Representations

Binary representation of integer numbers Operations on bits

Adding Binary Integers. Part 5. Adding Base 10 Numbers. Adding 2's Complement. Adding Binary Example = 10. Arithmetic Logic Unit

Transcription:

ECE 120 Midterm 1B HKN Review Session Time (self-scheduled): Between Wednesday, September 27 and Friday, September 29, 2017 Location: 57 Grainger Engineering Library (in the basement on the east side) Schedule Your Exam: cbtf.engr.illinois.edu (up to two weeks in advance) What to bring: icard, pens/pencils (They provide the scratch paper)

Overview of Review What to remember Abstraction Binary Operators Bitmasks C programming Practice Exam

Levels of Abstraction 1. The Problem - an ambiguous outline of the task at hand 2. The Algorithm - an unambiguous approach to solving said problem 3. Programming Language - means in which humans communicated their algorithm to the computer, ideally, without ambiguity. 4. Instruction State Architecture (ISA) - The basic set of operations available at the hardware level of a microprocessor. Eg. x86, LC-3, and MIPS 5. Microarchitecture - High level chip architecture/organization for performance 6. Elements of Microarchitecture - Implements various elements as Logic Circuits 7. Device - Actual materials and construction of parts composing logic circuits

Binary Representation Unsigned - k bits can represent [0, 2^k) values Can only represent non-negative integers Overflow Condition: If the most significant bit has a carry out Zero Extended - pad the front with zeros when moving to larger data type (10101) = (16+4+1) = 21 Signed Magnitude - (- 2^(k-1), 2^(k-1) ) values First bit determines sign of number ( 1 = negative, 0 = positive) (10101) = (-1) x (4+1) = -5

Binary Representation - Part II 2 s Complement - k bits represents [ -2^(k-1), 2^(k-1) - 1] Sign Extended - pad the front of the number with the sign bit when moving to larger data type Overflow Condition: if adding numbers of the same sign yields a result of the opposite sign If signed bit is 0, magnitude is same as if the number were treated as unsigned If signed bit is 1, to determine the magnitude, bitwise NOT the bits, and add 1 before finding magnitude 2 s complement provides a greater range of values and cleaner binary arithmetic operations ie. the same logic circuit used to add binary unsigned and 2 s complement numbers

ieee 754 Floating Point Representation Great for approximations & expressing very large/very small decimal values 1st bit is sign bit, 0 for positive and 1 for negative 2nd through 9th bit is exponent Special Cases: When exponent is 0 or 255, then denormalized or NAN/inf forms respectively. Denormalized format has normal sign, and magnitude: 0.mantissa * 2^(-126) NAN/inf form is NAN when mantissa is non-zero, and infinity (inf) when mantissa is all zeros 10th through 32nd bit is 23 bit mantissa Normal Form has magnitude of 1.mantissa * 2 ^ (exponent - 127) (-1)^sign * 1.fraction * 2^(exponent - 127)

Operators AND Returns 1 if both inputs are 1 OR Returns 1 if any of the inputs are 1 XOR NOT Returns 1 if either a or b is 1, not both Returns opposite of input ( 0->1, vice versa)

Bitmasks Great for looking at only certain bits A bitmask using AND as the bitwise operator will selectively mask bits to 0 A bitmask using OR as the bitwise operator will selectively mask bits to 1

C programming Variables Double, Long (8 bytes) Int, Float (4 bytes) Short (2 bytes) Char (1 byte)

Format Specifiers and Escape Sequences Format Specifiers: %c char single character %d (%i) int signed integer %e (%E) float or double exponential format %f float or double signed decimal %g (%G) float or double use %f or %e as required %o int unsigned octal value %p pointer address stored in pointer %s array of char sequence of characters %u int unsigned decimal %x (%X) int unsigned hex value Escape Sequences: \n - new line character \b - backspace character \t - horizontal tab \ - allows for storing and printing of ASCII value in string \\ - allows for storing and printing of \ ASCII value in string \ - allows for storing and printing of ASCII value in string \? - allows for storing and printing of? ASCII value in string Ie. char x = \ ; (those are 2 single quotes) will store the data byte associated with into x

C - operators Order of precedence *, /, %, then +, - (Note, Modular Arithmetic (%) is not defined for floating point numbers) Assignment operator Relational = (takes an lvalue on the left side and an rvalue on the right side to set the lvalue to the rvalue) IE, you can t do 5 = x; as 5 is an rvalue (you can t assign a value to 5!) ==,!=, <, >, <=, >= Bitwise Logical &,, ~, ^ (AND, OR, NOT, XOR)!, &&, (NOT, AND, OR)

C operators - bitwise examples

Basic Input / Output

Conditional Constructs

Conditional Constructs - Example

Iterative Constructs

Iterative - Example

Midterm 1B practice Exam