EE357Unit1_FixedPoint_Notes

EE357Unit1_FixedPoint_Notes - Learning Objectives...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
E 357 Unit 1 EE 357 Unit 1 Fixed Point Systems and Arithmetic © Mark Redekopp, All rights reserved earning Objectives Learning Objectives nderstand the size and systems used by Understand the size and systems used by the underlying HW when a variable is eclared in a SW program declared in a SW program • Understand and be able to find the ecimal value of numbers represented in decimal value of numbers represented in various systems in either binary or hex • Perform the various arithmetic and logic operations that the HW needs to perform © Mark Redekopp, All rights reserved • Be able to determine when overflow has occurred in an arithmetic operation onnecting C & EE 101 Connecting C & EE 101 his slide package is meant to review the This slide package is meant to review the basic data representation and operations at we learned in EE 101 but now in the that we learned in EE 101 but now in the context of a programming language like C e will show how the code you write in C • We will show how the code you write in C directs the compiler to control the HW in pecific ways specific ways © Mark Redekopp, All rights reserved Unsigned 2’s Complement ign and Zero Extension IGNED AND UNSIGNED Sign and Zero Extension Hexadecimal Representation SIGNED AND UNSIGNED SYSTEMS © Mark Redekopp, All rights reserved
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
inary Representation Systems Binary Representation Systems •I n t eger Systems • Codes gy – Unsigned • Unsigned (Normal) binary igned –T e x t • ASCII / Unicode ecimal Codes – Signed • Signed Magnitude • 2’s complement xcess * – Decimal Codes • BCD (Binary Coded Decimal) / (8421 Code) Excess-N 1’s complement* • Floating Point – For very large and small (fractional) numbers © Mark Redekopp, All rights reserved * = Not fully covered in this class ata Representation Data Representation • In C/C++ variables can be of different and ______ _____ – Integer Types (signed by default…unsigned with leading keyword) C Type Bytes Bits Coldfire Name MIPS Name [unsigned] char byte [unsigned] short [int] half-word [unsigned] long [int] word nsigned] long ng t ouble word – Floating Point Types [unsigned] long long [int] double word C Type Bytes Bits Coldfire/MIPS Name © Mark Redekopp, All rights reserved float double examp les C examples int x = -2; Allocates a 4-byte (32-bit) chunk of memory Any operation involving x will use signed operations, if necessary char c = 0xfa; Allocates a 1-byte (8-bit) chunk of memory unsigned char d = 10; Allocates a 1-byte chunk of memory Any operation involving d will use unsigned operations, if necessary float f = 3.1; Allocates a 4-byte (32-bit) chunk of memory Any operation involving f will use floating point HW double g = -1.5; Allocates an 8-byte (64-bit) chunk of memory nsigned ng ng llocates an 8 yte 4 it) chunk of memory unsigned long long y; Allocates an 8-byte (64-bit) chunk of memory short z = -1; Allocates a 2-byte (16-bit) chunk of memory © Mark Redekopp, All rights reserved nsigned and Signed Variables Unsigned and Signed Variables nsigned variables use unsigned binary
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/04/2010 for the course EE 357 taught by Professor Mayeda during the Spring '08 term at USC.

Page1 / 9

EE357Unit1_FixedPoint_Notes - Learning Objectives...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online