ECEN 215, Principles of Electrical EngineeringDr. Mina RahimianLecture# 24 Date: 11/20/13Adding binary numbersNegative numbersA negative number can be represented by two's complement of the corresponding positive number.The two's complement is obtained by adding 1 to the inverted nubmer neglecting the carry (if any) out of the most significant bit.Another way to obtain two's complement:Start from the least significant bit, copy the digits from right to left. After the first 1 is coppied, invert the remaining digits.For example the two's complement of 01010100 is:An unsigned 8-bit number can represent 28 =256 distinct numbers (0 to 255) .A signed 8-bit number can represent 28 =256 distinct numbers, half of them positive and half negative. (-128 to +127).In a signed two's complement number, the first bit is the sign bit, 0 means positive and 1 means negative.Subtraction can be performed using 2's complement arithmatic.Ex. Perform the operation: 37-34, using 8-bit signed 2's complement arithmatic.Combinational logic circuitsLogic gates are circuits that combine several logic variable inputs to produce a logic variable at the output. AND GateAND gate performs logical multiplication. The output of the AND gate is 1 only if all inputs are 1.All possible combinations may be listed in a table called truth table.NOT gate ( Logic inverter)The NOT gate output is inverted input. OR gateThe output of an OR gate is 0 only if all inputs are 0. A or B is written as A+B.NAND gateNAND operation is the inversion of the result obtained fron AND operation. The result is 0 only when all inputs are 1, otherwise it is 1.NOR gateNOR operation is the inversion of the result obtained fron OR operation. The result is 1 only when all inputs are 0, otherwise it is 0.XOR gateXOR (Exclusive OR) operation produces 0 at the output only when both inputs are equal, otherwise it is 1.Boolean AlgebraManipulation of logic variables by AND, OR, NOT and other operations is different from ordinary algebra. In 1849 George Boole developed the mathematics of logic variables which is known as Boolean algebra which is based on logical thought and reasoning.Boolean algebra is the algebra of two values 0 (or False) and 1(or true).Rules of Boolean algebra:To prove that two logic statements are equal we need to show that they have identical truth table.Implementation of Boolean AlgebraA Boolean expression can be implemented using a logic circuit with AND, OR, and NOT gates.Ex. A laptop design has two processors (P1 and P2) and four slots for memory chips (S1, S2, S3, S4).When processor P1 is running, it uses the memory in slot S1. When processor P2 is running, it uses the memory in slot S4.When both processors are running simultaneously, they use memory in slots S2 and S3.Design a logic circuit to connect the processors and the memory slots. If a processor is running it produces high output to activate the memory
View Full Document