Lecture 3 - Boolean Algebra

# 2013 lecture 3 awb floating point bias 10 the valid

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: m −3 to 3. By adding bias (=3), we can move the range so it is from 0 to 6: true biased MSB -3 0 0 -2 → 1 0 -1 → 2 0 0 → 3 0 1 → 4 1 2 → 5 1 3 January 24, 2013 → → 6 1 Lecture 3 AWB Floating point - bias 11 With the bias, ﬂoating point numbers can be treated as unsigned integers for which comparing is easy. • For non positive exponents the MSB = 0 • For positive exponents the MSB = 1 (Bias ”reverses” the meaning of the MSB in two’s complement). Adding and subtracting bias is less costly than having separate ways for comparing unsigned and ﬂoating point. January 24, 2013 Lecture 3 AWB Floating point - bias 12 Introducing bias decreases the set of valid normalized numbes. This allows for representation of ’special’ symbols like NaN, Inf, denormalize, etc. • NaN - for example when dividing 0 by 0, • Inf - for example when product is larger than the max number, • Denormalize - no leading 1 in the mantissa: x = (1 2s)2c · (0.m) January 24, 2013 Lecture 3 AWB Floating point - special numbers 13 Number Sign bit 0 don’t care all 0’s all 0’s ∞ 0 all 1’s all 0’s −∞ 1 all 1’s all 0’s NaN X all 1’s non-zero denormals 0,1 all 0’s non-zero January 24, 2013 Exponent bits Fraction bits Lecture 3 AWB Floating point arithmetic 14 Floating point used in scientiﬁc computations • abraviated as f l arithmetic • very involved • performed by a separate (from binary adder) circuit • read and understand f l addition on page 257 in text More things to remember • biased exponent • special sysmbols January 24, 2013 Lecture 3 AWB Logic gates 15 ab Full Adder cout (a + b + c)20 = cout 21 + s20 FA cin s Q: What is inside the FA module? A: circuits built from logic gates. Logic gates represent Boolean operations performed on binary variables. January 24, 2013 Lecture 3 AWB Boolean algebra 16 A set of two elements X = {0, 1} ({TRUE, {FALSE) endowed with operations AND, OR and NOT. Operations are deﬁned by Truth Tables. AND 1 OR 0 1 NOT 0 0 0 0 0 1 0 1 1 TT: 0 0 1 1 1 1 1 0 Gates: January 24, 2013 Lecture 3 AWB Boolean expressions 17 A, B ∈ {0, 1} are called binary variables. Boolean expression is a logical expression that evaluates to TRUE or FALSE (0 or 1). Boolean expressions are obtained from binary variables or other Boolean expression by combining them by Boolean operators. January 24, 2013 Lecture 3 AWB Boolean expressions 18 Boolean expression Circuit A Y = A AND B . B Y A = 0, B = 1 ⇒ Y = ? A Y = (A OR (NOT B )) AND C B C A = 1, B = 1, C = 0 ⇒ Y = ? January 24, 2013 Lecture 3 AWB Alternative notation 19 A AND B ↔ A·B A OR B ↔ NOT A ↔ A+B ¯ A Y = (A OR (NOT B )) AND C January 24, 2013 Lecture 3 ¯ ↔ (A + B ) · C AWB Other binary operations 20 NAND 0 1 NOR 0 1 XOR 0 1 0 1 1 0 1 0 0 0 1 1 1 0 1 0 0 1 1 0 A Y B (A · B ) January 24, 2013 A Y B (A + B ) Lecture 3 a s b A⊕B AWB Some properties 21 ’·’ 0 1 ’ +’ 0 1 NOT 0 0 0 0 0 1 0 1 1 0 1 1 1 1 1 0 (P1) Idempotency: x + x =...
View Full Document

## This note was uploaded on 09/26/2013 for the course ECE 2300 taught by Professor Long during the Fall '08 term at Cornell.

Ask a homework question - tutors are online