lec1-7-Rev1

lec1-7-Rev1 - WPI ECE2801 Foundations of Embedded Systems...

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

View Full Document Right Arrow Icon
WPI ECE2801 Foundations of Embedded Systems Lecture 7: Review 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
EE2801: Foundations of Embedded Systems Lecture 8 Review: Data Representation Rules for interpreting numbers, meaning given to an arbitrary collection of binary bits Characters: ASCII code Integers: unsigned, singed (sigh-magnitude, two’s complement), BCD Fractional numbers: fixed-point, Floating- point
Background image of page 2
EE2801: Foundations of Embedded Systems Lecture 8 Integer representation Unsigned, sign magnitude, two's complement and packed BCD Expect Conversion Between Bases and Formats! Unsigned integers = all bits used to convey magnitude (whole numbers) 1026 = 00000100 00000010b = 0402h Sign Magnitude integers = n- 1 bits used to convey magnitude with “most significant bit” or MSB used for sign (0 = +, 1 = -) 1026 = 00000100 00000010b = 0402h -1026= 10000100 00000010b = 8402h ** Has 2 representations of 0. It is BAD
Background image of page 3

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

View Full DocumentRight Arrow Icon
EE2801: Foundations of Embedded Systems Lecture 8 Integer representation Two's Complement integers = Common format for signed integers (int). For n bits, values run from -2 (n-1) to 2 (n-1) -1 Positive numbers: Same as Unsigned 1026 = 00000100 00000010b = 0402h Negative numbers: Encode magnitude, Complement each bit, Add 1 -1026: 0000 0100 0000 0010 = 1026 1111 1011 1111 1101 complement +1 1111 1011 1111 1110 = 0FBFEh = -1026 in two's complement
Background image of page 4
EE2801: Foundations of Embedded Systems Lecture 8 Integer representation Packed Binary Coded Decimal = A simple “legacy” format. Each decimal digit expressed in a binary nibble 367 = 0000 0011 0110 0111 = 0367h Hexidecimal (hex) Numbers: Base 16 1 Hex character represent values from 0 to 15d using digits 0 – Fh 158d = 9Eh Conversion between hex and binary is piece of cake! Just convert each hex digit to a binary nibble. .. 158d =1001 1110b = 9Eh 9 E Or vise versa 2AC4h = 0010 1010 1100 0100 b 2 A C 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
EE2801: Foundations of Embedded Systems Lecture 8 Fractional Number representations Fixed point : Binary radix point assigned a fixed location in byte (or word) 0101.1010 = 5 + 2
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 21

lec1-7-Rev1 - WPI ECE2801 Foundations of Embedded Systems...

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

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