




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
computer graphics notes for examination.
Typology: Cheat Sheet
1 / 230
This page cannot be seen from the preview
Don't miss anything!





























































































Background and Acknowledgements This material has been developed for the first course in Digital Logic Design. The content is derived from the author’s educational, technical and management experiences, in-addition to teaching experience. Many other sources, including the following specific sources, have also informed by the content and format of the following material: Katz, R. Contemporary Logic Design. (2005) Pearson. Wakerly, I. Digital Design. (2006) Prentice Hall. Sandige, R. Digital Design Essentials. (2002) Prentice Hall. Nilsson, J. Electrical Circuits. (2004) Pearson. I would like to give special thanks to my students and colleagues for their valued contributions in making this material a more effective learning tool. I invite the reader to forward any corrections, additional topics, examples and problems to me for future Thanks,
www.EngrCS.com © 2014 Izad Khormaee, All Rights Reserved.
Natural forces and signals are all analog (or continuous) which means we hear, see and change items in a continuous manner. On the other hand, our digital technology (also called non-continuous or 2-value discrete) more effectively allows us to process and communicate more effectively. This leads us to design systems that fit the following block diagram architecture: Why convert analog data to digital data? We have the information we need (on-off, timing) Above a certain level is on, high, 1-state or true. Below a certain level is off, low, 0-state or False. Note: We have introduced a discontinuity when a signal goes from 1 to 0 or 0 to 1. This means we cannot say what the exact value is at the time of transition. Reduces complexity of signals and the solutions to work with the signal. To deal with a digital signal we need to deal with binary algebra. To deal with an analog signal we need to deal with calculus to approximate. Positive vs. Negative logic Positive Logic Convention (Default easier for humans to understand) H, (V > Vmax) is 1-state or True L, (V < Vmin) is 0-state or False Negative Logic Convention (1 is L and 0 is H) H, (V > Vmax) is 0-state or False L, (V < Vmin) is 1-state or True Real World Signal Analog to Digital Convertor (Audio, ..) Process/ Store/ Communicate Convertor Digital to Analog Convertor (Audio, ..) Real World Signal Example: Music Microphone Memory Chip Speaker Music
Example of analog and digital representations of human Heart Beat: Based on the definition of a digital (2-valued) system, what are some examples where a digital system could apply? What are the variables and on/off or high/low states? Example: Describe the input and output of a traffic intersection in digital form. Solution: Car’s presence at an intersection: (Car PresentMagnitude is 1, No Car PresentMagnitude is 0) Status of Traffic Lights: (Red-on 1, Red-off 0) Extension: draw a typical Intersection and label the output and input in digital form. t
Vmax Vmin H (>Vmax) L (<Vmin)
t Analog to Digital Converter (ADC) Digital to Analog Converter (DAC)
Medium Scale Integration, MSI PAL--Programmable Array Logic, GAL--Generic Array Logic, EPROM--Erasable Programmable Read Only Memory, ADDER, COUNTER) 1,000s to 100,000s of gates. Typically, the vendor provides information in the form of a data sheet Large Scale Integration (LSI) 100,000s to Millions of gates Typically implements complex functionality Processors such as special function controllers and interface chips Very Large Scale Integration (VLSI) Millions to Billions of gates Typically includes extensive functionality Processors such as Intel’s Pentium are examples of VLSI. Design / Analysis tools We will be using manual processes for most of this text to design/analyze digital circuits in order to gain in-depth understanding of logic design. The final section of this text is dedicated to the use of Hardware Description Language (HDL) to automate design, simulation, implementation, and analysis and verification process.
Input Output A B 0 1
Digital design depends on the type of problem, the work already completed, the strategic direction of the organization and the skills/resources available to the project team. Having said that, in general, there are three approaches available to the designers under traditional Hierarchical-Oriented Designs: Top-down Design Methodology Start with larger block of design and then work out the detail of each block. Bottom-up Design Methodology Start with components and figure out how to interconnect them to design the system. Middle-out Design Methodology A combination of the bottom-up and top-down. Most designs are done this way: start with the top-down design, then modify the design to take advantage of the available components (based on cost, availability, and reliability). Another way of thinking about the problem of design that has a strong following in the software development community and is being used in the hardware community under the module design concept is Object-Oriented Design (OOD). Designers commonly agree that there are four main properties or benefits associated with object-oriented design: Encapsulation As the name implies, the internals of the design are hidden from the user and only the interface definition (input/output) are available to the user. Users benefit since they have a limited amount of information to learn. Designers benefit since they are able to upgrade the module without involving the user as long as the new interface is a superset of an existing interface. Inheritance This simply means that an object may be built on the features available in the base object property. Of course, the benefit is that the designers only have to work on the additional feature and simply reuse the existing functionality. Polymorphism OOD allows the designer to create objects that behave differently based on the attributes of input. Composition (One object can be built using many others.) A new object may be developed based on the composition of multiple existing objects. Hopefully, at this point you are thinking “why wouldn’t everyone use OOD?” The main drawback of OOD is the high level of planning required for each module, and discipline needed to follow the four properties in design.
Note: The general term for decimal point is radix point In binary, the count starts at 0 (called 0-referencing), where in decimal, the count typically starts with 1 (called 1-referencing) Octal (base 8) and Hexadecimal (base 16) These number systems are used by humans as a representation of long strings of bits since they are: Easier to read and write, for example (347) 8 is easier to read and write than (011100111) 2. Easy to convert (Groups of 3 or 4) Today, the most common way is to use Hex to write the binary equivalent; two hexadecimal digits make a Byte (groups of 8-bit), which are basic blocks of data in Computers. Question: The hexadecimal system is base 16, so the digits range in value from 0 to 15. How do you represent Hexadecimal digits above 9? Use A for 10, B for 11, C for 12, D for 13, E for 14 and F for 15. So (CAB) 16 or (CAB)HEX is a valid hexadecimal number. Computer memory is typically organized in 8-bit groups or bytes. Why groups of 8?
Decimal to Binary Conversion Alternative 1 – “Subtract the weight method”
Find the largest power of 2 (2n) that can be subtracted out of the decimal number Take the result and subtract (2n-1) from it If the result is not negative then that bit is one If the result is negative, then that bit is zero and the result equals the result from step 1 Repeat step 2 until the result is exactly 0
Alternative 2 – “Division by 2 method”
Divide the decimal number by 2 Remainder is the least significant bit (most right bit) Quotient is used in the next step Divide quotient by 2 Remainder is the next significant bit (next left bit) Quotient is used in the next step Repeat previous step until quotient is 0
Binary to Decimal Conversion – “Add the weight method” Step: Simply multiply each bit with its weight and add to get the decimal number Example: Convert (110001) 2 to a decimal number (110001) 2 = ( 1* 2^5 + 1* 2^4 + 0* 2^3 + 0* 2^2 + 0* 2^1 + 1* 2^0 ) 10 = (49) 10 Binary Octal Conversion - “Group of 3 method” Remainder 2|49 1 (LSB) 2|24 0 2|12 0 2| 6 0 2| 3 1 2| 1 1 (MSB) 2| 0 Stop
2 n^ Results
Binary # ( 1 1 0 0 0 1) 2
0 When =0, done
Therefore (52) 10 = (110100) 2 Decimal Fraction Conversion to any Base – “Repeated Radix Multiplication Method” Solution is based on the approach: (decimal fraction) 10 = d-1 r--1^ + d-2 r--2^ + … = (.dn…d 2 d 1 d 0 )r r*(decimal fraction) 10 = d-1 + d-2r-1^ + … = (.d-1d-2d-3 … )r Steps: (1) Multiply (fraction) 10 by r, the non-fractional part is the first digit (2) Continue step 2 until fraction is 0 Example: Convert (.125) 10 to binary (r=2) Solution: Therefore (.125) 10 = (.001) 2 Note: Some numbers may not be fully convertible, so you have to decide the number of decimal points you need to convert. For example (1/12) 10 does not fully convert to binary number.
d-
d-
d- Fraction is 0 which means d-3 is the Least Significant Digit Non-fraction portion is 1 which means d-3 is 1. Non-fraction portion is 0 which means d-1 ,the Most Significant Digit, is 0.
Remainders R 0 =d 0 =0 R 1 =d 1 =0 R 2 =d 2 =1 R 3 =d 3 =0 R 4 =d 4 =1 R 5 =d 5 =
Quotient is 0 therefore remainder is MSB First Remainder is the LSB
Signed Binary Number Representations (3 methods) Signed Magnitude (SM) Easiest for people to read (Not used by computers) Here is an example of Signed Magnitude number with 4-bit word size Binary SM numbers for n-bit word ranges from +(2n-1^ – 1) to -(2n-1^ – 1) Note: there are two values for zero (Sign-bit = 1 and Sign-bit=0) Example of complete list of binary SM numbers for a 4-bit word. Binary SM Number (n=4) Decimal Number d3 d2 d1 d 0 1 1 1 + 7 = +(24 -1^ -1) 0 1 1 0 + 6 0 1 0 1 + 5 0 1 0 0 + 4 0 0 1 1 + 3 0 0 1 0 + 2 0 0 0 1 + 1 0 0 0 0 + 0 1 0 0 0 - 0 1 0 0 1 - 1 1 0 1 0 - 2 1 0 1 1 - 3 1 1 0 0 - 4 1 1 0 1 - 5 1 1 1 0 - 6 1 1 1 1 - 7 = -(24 -1^ -1) Diminished Radix Complement (DRC) or 1’s complement Some computer systems use this information because it is easier to convert. To obtain a negative DRC or 1’s complement: Write a positive number with MSB set to 0 (positive sign) Negate (Invert) every bit including sign bit to obtain the negative number.
One Sign Bit 0 + 1 - 3 Magnitude Bit
RC numbers for n-bit word range from +(2n-1^ – 1) to –(2n-1) with the following two characteristics: The range is not symmetrical, there is one more negative number than there are positive numbers. There is only one pattern for zero (-0 and +0 have the same pattern) Example of Binary RC or 2’s Complement Numbers for a 4-bit word Binary SM Number (n=4) Decimal Number d3 d2 d1 d 0 1 1 1 + 7 = +(24 -1^ -1) 0 1 1 0 + 6 0 1 0 1 + 5 0 1 0 0 + 4 0 0 1 1 + 3 0 0 1 0 + 2 0 0 0 1 + 1 0 0 0 0 + 0 0 0 0 0 - 0 1 1 1 1 - 1 1 1 1 0 - 2 1 1 0 1 - 3 1 1 0 0 - 4 1 0 1 1 - 5 1 0 1 0 - 6 1 0 0 1 - 7 1 0 0 0 -8 == -24 - Quick Inspection Method Finding 2’s complement Working from the LSB of the number to be complemented toward the MSB (right to left), rewrite each bit up to and including the first “1” encountered, then complement each bit thereafter Example: MSB LSB Old Number: (1 0 1 1 0 1 0) 2’s Complement: (0 1 0 0 1 1 0) **Note: 2’s complement gets you back to the original number.
Bit-invert 1 0 1 0 Add 1 + 1
2’s Compl. (1 0 1 1)2RC One Sign Bit 0 + 1 - 3 Magnitude Bit
All of today’s computer systems use RC numbers (2’s complement) for binary arithmetic operations. The reset of this section provides description of Binary Arithmetic using RC numbers. Addition of Signed Binary Numbers When adding RC numbers, simply add then ignore the left-most carry. +7 0 1 1 1 +(-2) 1 1 1 0
0 1 0 1 “Ignore the left-most carry, and the result is +5” Notes: The left-most bit is a sign bit and there are three magnitude bits. As long as we know results fits within the 1 sign-bit and n magnitude bits, this process works. Otherwise we need to consider the overflow. Addition of Unsigned Binary Numbers Unsigned addition Signed works exactly the same way as singed addition, allowing us to use the same circuitry. +7 0 1 1 1 +3 0 0 1 1
1 0 1 0 “Result is +10. If there is a carry beyond the available bits, then an an overflow has occurred. Overflow An overflow occurs when the addition of two numbers results in a number larger than can be expressed with the available number of bits. Example – performing the operation, 8+9=17; in a 4-bit word system, results in an overflow since 4 bits can only store 0 to 15. The result will show as a 1, which is 16 less than the correct result. Detecting overflow Unsigned number addition If the addition has a carry beyond the available bits then an overflow has occurred. Signed (RC, 2’s complement) number addition If the operands have different signs, then overflow cannot occur, since one number is being subtracted from the other. If the operands have the same sign and the result has a different sign, then an overflow has occurred. A quick way to identify an overflow situation is when the carry into the sign-bit position and the carry out of sign-bit position are different. Example