On Tue, Oct 4, 2011 at 3:38 AM, Rana Anjum <anjumdyn@gmail.com> wrote:
An Overview & Number SystemsAnalogue versus DigitalMost of the quantities in nature that can be measured are continuous. Examplesinclude• Intensity of light during the day: The intensity of light gradually increases as thesun rises in the morning; it remains constant throughout the day and then graduallydecreases as the sun sets until it becomes completely dark. The change in the lightthroughout the day is gradual and continuous. Even with a sudden change in weatherwhen the sun is obscured by a cloud the fall in the light intensity although very sharphowever is still continuous and is not abrupt.• Rise and fall in temperature during a 24-hour period: The temperature also risesand falls with the passage of time during the day and in the night. The change intemperature is never abrupt but gradual and continuous.• Velocity of a car travelling from A to B: The velocity of a car travelling from onecity to another varies in a continuous manner. Even if it abruptly accelerates or stopssuddenly, the change in velocity seemingly very sudden and abrupt is never abrupt inreality. This can be confirmed by measuring the velocity in short time intervals of fewmilliseconds.The measurable values generally change over a continuous range having a minimumand maximum value. The temperature values in a summer month change between 23 0Cto 45 0C. A car can travel at any velocity between 0 to 120 mph.Digital representing of quantitiesDigital quantities unlike Analogue quantities are not continuous but representquantities measured at discrete intervals. Consider the continuous signal as shown in thefigure 1.1.To represent this signal digitally the signal is sampled at fixed and equal intervals.The continuous signal is sampled at 15 fixed and equal intervals. Figure 1.2. The set ofvalues (1, 2, 4, 7, 18, 34, 25, 23, 35, 37, 29, 42, 41, 25 and 22) measured at the samplingpoints represent the continuous signal. The 15 samples do not exactly represent theoriginal signal but only approximate the original continuous signal. This can beconfirmed by plotting the 15 sample points. Figure 1.3. The reconstructed signal from the15 samples has sharp corners and edges in contrast to the original signal that has smoothcurves.If the number of samples that are collected is reduced by half, the reconstructed signalwill be very different from the original. The reconstructed signal using 7 samples havemissing peak and dip at 34 0C and 23 0C respectively. Figure 1.4. The reason for thedifference between the original and the reconstructed signal is due to under-sampling. Amore accurate representation of the continuous signal is possible if the number ofCS302 – Digital Logic DesignVirtual University of Pakistan Page 2samples and sampling intervals are increased. If the sampling is increased to infinity thenumber of values would still be discrete but they would be very close and closely matchthe actual signal.Figure 1.1 Continuous signal showing temperature varying with timeFigure 1.2 Sampling the Continuous Signal at 15 equal intervals0510152025303540451 2 3 4 5 6 7 8 9 10 11 12 13 14 15timetemperature 0C1 247342523372942 41252218350510152025303540451 2 3 4 5 6 7 8 9 10 11 12 13 14 15timetemperature 0CCS302 – Digital Logic DesignVirtual University of Pakistan Page 3Figure 1.3 Reconstructed Signal by plotting 15 sampled valuesFigure 1.4 Reconstructed Signal by plotting 7 sampled valuesElectronic Processing of Continuous and Digital QuantitiesElectronic Processing of the continuous quantities or their Digital representationrequires that the continuous signals or the discrete values be converted and represented interms of voltages. There are basically two types of Electronic Processing Systems.• Analogue Electronic Systems: These systems accept and process continuous signalsrepresented in the form continuous voltage or current signals. The continuous1 2471834252335372942 4125220510152025303540451 2 3 4 5 6 7 8 9 10 11 12 13 14 15samplestemperature 0C0510152025303540451 3 5 7 9 11 13 15samplestemperature 0CCS302 – Digital Logic DesignVirtual University of Pakistan Page 4quantities are converted into continuous voltage or current signals by transducers. Theblock diagram describes the processing by an Analogue Electronic System. Figure1.5.• Digital Electronic Systems: These systems accept and process discrete samplesrepresenting the actual continuous signal. Analogue to Digital Converters are used tosample the continuous voltage signals representing the original signal.Do the Digital Electronic Systems use voltages to represent the discrete samples ofthe continuous signal? This question can be answered by considering a very simpleexample of a calculator which is a Digital Electronic System. Assume that a calculator iscalibrated to represents the number 1 by 1 millivolt (mV). Thus the number 39 isrepresented by the calculator in terms of voltage as 39 mV. Calculators can also representlarge numbers such as 6.25 x 1018 (as in 1 Coulomb = 6.25 x 1018 electrons). The value interms of volts is 6.25 x 1015 volts! This voltage value can not be practically representedby any electronic circuit. Thus Digital Systems do not use discrete samples represented asvoltage values.Figure 1.5 Analogue Electronic System processing continuous quantitiesDigital Systems and Digital ValuesDigital systems are designed to work with two voltage values. A +5 volts represents alogic high state or logic 1 state and 0 volts represents a logic low state or logic 0 state.The Digital Systems which are based on two voltage values or two states can easilyrepresent any two values. For example,• The numbers '0' and '1'• The state of a switch 'on' or 'off'• The colour 'black' and 'white'• The temperature 'hot' and 'cold'• An object 'moving' or 'stationary'CS302 – Digital Logic DesignVirtual University of Pakistan Page 5Representing two values or two states is not very practical, as many naturallyoccurring phenomenons have values or state that are more than two. For example,numbers have widely varying ranges, a colour palette might have 64 different shades ofthe colour red, the temperature of boiling water at room temperature varies from 30 0C to100 0C. Digital Systems are based on the Binary Number system which allows more thantwo or multiple values to be represented very conveniently.Binary Number SystemThe Binary Number System unlike the Decimal number system is based on twovalues. Each digit or bit in Binary Number system can represent only two values, a '0'and a '1'. A single digit of the Decimal Number system represents 10 values, 0, 1, 2 to 9.The Binary Number System can be used to represent more than two values by combiningbinary digits or bits. In a Decimal Number System a single digit can represent 10different values (0 to 9), representing more than 10 values requires a combination of twodigits which allows up to 100 values to be represented (0 to 99). A Combination ofBinary Numbers is used to represent different quantities.• Represent Colours: A palette of four colours red, blue, green and yellow can berepresented by a combination of two digital values 00, 01, 10 and 11 respectively.• Representing Temperature: An analogue value such as 39oC can be represented in adigital format by a combination of 0s and 1s. Thus 39 is 100111 in digital form.Any quantity such as the intensity of light, temperature, velocity, colour etc. can berepresented through digital values. The number of digits (0s and 1s) that represents aquantity is proportional to the range of values that are to be represented. For example, torepresent a palette of eight colours a combination of three digits is used. Representing atemperature range of 00 C to 1000 C requires a combination of up to seven digits.Digital Systems uses the Binary Number System to represent two or multiplevalues, stores and processes the binary values in terms of 5 volts and 0 volts. Thus thenumber 39 represented in binary as 100111 is stored electronically in as +5 v, 0v, 0v, +5v, +5 v and +5 v.Advantages of working in the Digital DomainHandling information digitally offers several advantages. Some of the merits of adigital system are spelled out. Details of some these aspects will be discussed and studiedin the Digital Logic Design course. Other aspects will be covered in several othercourses.• Storing and processing data in the digital domain is more efficient: Computersare very efficient in processing massive amounts of information and data. Computersprocess information that is represented digitally in the form of Binary Numbers. ADigital CD stores large number of video and audio clips. Sam number of audio andvideo clips if stored in analogue form will require a number of video and audiocassettes.• Transmission of data in the digital form is more efficient and reliable: Moderninformation transmission techniques are relying more on digital transmission due toCS302 – Digital Logic DesignVirtual University of Pakistan Page 6its reliability as it is less prone to errors. Even if errors occur during the transmissionmethods exist which allow for quick detection and correction of errors.• Detecting and Correcting errors in digital data is easier: Coding Theory is an areawhich deals with implementing digital codes that allow for detection and correctionof multi-bit errors. In the Digital Logic Design course a simple method to detectsingle bit errors using the Parity bit will be considered.• Data can be easily and precisely reproduced: The picture quality and the soundquality of digital videos are far more superior to those of analogue videos. The reasonbeing that the digital video stored as digital numbers can be exactly reproduced whereas analogue video is stored as a continuous signal can not be reproduced with exactprecision.• Digital systems are easy to design and implement: Digital Systems are based ontwo-state Binary Number System. Consequently the Digital Circuitry is based on thetwo-voltage states, performing very simple operations. Complex Microprocessors areimplemented using simple digital circuits. Several simple Digital Systems will bediscussed in the Digital Logic course.• Digital circuits occupy small space: Digital circuits are based on two logical states.Electronic circuitry that implements the two states is very simple. Due to thesimplicity of the circuitry it can be easily implemented in a very small area. The PCmotherboard having an area of approximately 1 sq.ft has most of the circuitry of apowerful computer. A memory chip small enough to be held in the palm of a hand isable to store an entire collection of books.Information Processing by a Digital SystemA Digital system such as a computer not only handles numbers but all kinds ofinformation.• Numbers: A computer is able to store and process all types of numbers, integers,fractions etc. and is able to perform different kinds of arithmetic operations on thenumbers.• Text: A computer in a news reporting room is used to write and edit news reports. AMathematician uses a computer to write mathematical equations explaining thedissipation of heat by a heat sink. The computer is able to store and process text andsymbols.• Drawings, Diagrams and Pictures: A computer can store very convenientlycomplex engineering drawings and diagrams. It allows real life still pictures or videosto be processed and edited.• Music and Sound: Musicians and Composers uses\ a computer to work on a newcompositions. Computers understand spoken commands.A Digital System (computer) is capable of handling different types of information,which is represented in the form of Binary Numbers. The different types of informationuse different standards and binary formats. For example, computers use the Binarynumber system to represent numbers. Characters used in writing text are representedthrough yet another standard known as ASCII which allows alphabets, punctuation marksand numbers to be represented through a combination of 0s and 1s.CS302 – Digital Logic DesignVirtual University of Pakistan Page 7Digital Components and their internal workingDigital system process binary information electronically through specialized circuitsdesigned for handling digital information. These circuits as mentioned earlier operatewith two voltage values of +5 volts and 0 volts. These specialized electronic circuits areknown as Logic Gates and are considered to be the Basic Building Blocks of any Digitalcircuit.The commonly used Logic Gates are the AND gate, the OR gate and the Inverter orNOT Gate. Other gates that are frequently used include NOR, NAND, XOR and XNOR.Each of these gates is designed to perform a unique operation on the input informationwhich is known as a logical or Boolean operation.Large and complex digital system such as a computer is built using combinations ofthese basic Logic Gates. These basic building blocks are available in the form ofIntegrated Circuit or ICs. These gates are implemented using standard CMOS and TTLtechnologies that determine the operational characteristics of the gates such as the powerdissipation, operational voltages (3.3v or 5 v), frequency response etc.Figure 1.6 Symbolic representations of logic gates.Combinational Logic Circuits and Functional DevicesThe logic gates which form the basic building blocks of a digital system are designedto perform simple logic operations. A single logic gate is not of much use unless it isconnected with other gates to collectively act upon the input data. Different gates arecombined to build a circuit that is capable of performing some useful operation likeadding three numbers. Such circuits are known as Combinational Logic Circuits orCombinational Circuits. An Adder Combinational Circuit that is able to add two singlebit binary numbers and give a single bit Sum and Carry output is shown. Figure 1.7.Implementing large digital system by connecting together logic gates is very tediousand time consuming; the circuit implemented occupies large space, are power hungry,slow and are difficult to troubleshoot.CS302 – Digital Logic DesignVirtual University of Pakistan Page 8Figure 1.7 1-bit Full-Adder Combinational CircuitDigital circuits to perform specific functions are available as Integrated Circuits foruse. Implementing a Digital system in terms of these dedicated functional units makesthe system more economical and reliable. Thus an adder circuit does not have to beimplemented by connecting various gates, a standard Adder IC is available that can bereadily used. Other commonly used combinational functional devices are Comparators,Decoders, Encoders, Multiplexers and Demultiplexers.Sequential logic and implementationDigital systems are used in vast variety of industrial applications and house holdelectronic gadgets. Many of these digital circuits generate an output that is not onlydependent on the current input but also some previously saved information which is usedby the digital circuit. Consider the example of a digital counter which is used by manydigital applications where a count value or the time of the day has to be displayed. Thedigital counter which counts downwards from 10 to 0 is initialized to the value 10. Whenthe counter receives an external signal in the form of a pulse the counter decrements thecount value to 9. On receiving successive pulses the counter decrements the currentlystored count value by one, until the counter has been decremented to 0. On reaching thecount value zero, the counter could switch off a washing machine, a microwave oven orswitch on an air-conditioning system.The counter stores or remembers the previous count value. The new count value isdetermined by the previously stored count value and the new input which it receives inthe form of a pulse (a binary 1). The diagram of the counter circuit is shown in the figure.Figure 1.8.Digital circuits that generate a new output on the basis of some previously storedinformation and the new input are known as Sequential circuits. Sequential circuits are acombination of Combinational circuits and a memory element which is able to store someprevious information. Sequential circuits are a very important part of digital systems.Most digital systems have sequential logic in addition to the combinational logic. AnABΣCoutCinPGCS302 – Digital Logic DesignVirtual University of Pakistan Page 9example of sequential circuits is counters such as the down-counter which generates anew decremented output value based on the previous stored value and an external input.The storage element or the memory element which is an essential part of a sequentialcircuit is implemented a flip-flop using a very simple digital circuit known as a flip-flop.Figure 1.8 A Counter Sequential CircuitProgrammable Logic Devices (PLDs)The modern trend in implementing specialized dedicated digital systems is throughconfigurable hardware; hardware which can be programmed by the end user. A digitalcontroller for a washing machine can be implemented by connecting together pieces ofcombinational and sequential functional units. These implementations are reliablehowever they occupy considerable space. The implementation time also increases. Ageneral purpose circuit that can be programmed to perform a certain task like controllinga washing machine reduces the implementation cost and time.Cost is incurred on implementing a digital controller for a washing machine whichrequires that an inventory of all its components such as its logic circuits, functionaldevices and the counter circuits be maintained. The implementation time is significantlyhigh as all the circuit components have to be placed on a circuit board and connectedtogether. If there is a change in the controller circuit the entire circuit board has to beredesigned. A PLD based washing machine controller does not require a large inventoryof components to be maintained. Most of the functionality of the controller circuit isimplemented within a single PLD integrated circuit thereby considerably reducing thecircuit size. Changes in the controller design can be readily implemented byprogramming the PLD.Programmable Logic Devices can be used to implement Combinational andSequential Digital Circuits.CS302 – Digital Logic DesignVirtual University of Pakistan Page 10MemoryMemory plays a very important role in Digital systems. A research article beingedited by a scientist on a computer is stored electronically in the digital memory whilstchanges are being made to the document. Once the document has be finalized and storedon some media for subsequent printing the memory can be reused to work on some otherdocument. Memory also needs to store information permanently even when the electricalpower is turned off. Permanent memories usually contain essential information requiredfor operating the digital system. This important information is provided by themanufacturer of a digital system.Memory is organized to allow large amounts of data storage and quick access.Memory (ROM) which permanently stores data allows data to be read only. The Memorydoes not allow writing of data. Volatile memory (RAM) does not store informationpermanently. If the power supplied to the RAM circuitry is turned off, the contents of theRAM are permanently lost and can not be recovered when power is restored. RAMallows reading and writing of data. Both RAM and ROM are an essential part of a digitalsystem.Analogue to Digital and Digital to Analogue conversion andInterfacingReal-world quantities as mention earlier are continuous in nature and have widelyvarying ranges. Processing of real-world information can be efficiently and reliably donein the digital domain. This requires real-world quantities to be read and converted intoequivalent digital values which can be processed by a digital system. In most cases theprocessed output needs to be converted back into real-world quantities. Thus twoconversions are required, one from the real-world to the digital domain and then backfrom the digital domain to the real-world.Modern digitally controlled industrial units extensively use Analogue to Digital (A/D)and Digital to Analogue (D/A) converters to covert quantities represented as an analoguevoltage into an equivalent digital representation and vice versa. Consider the example ofan industrial controller that controls a chemical reaction vessel which is being heated toexpedite the chemical reaction. Figure 1.9. Temperature of the vessel is monitored tocontrol the chemical reaction. As the temperature of the vessel rises the heat has to bereduced by a proportional level. An electronic temperature sensor (transducer) convertsthe temperature into an equivalent voltage value. This voltage value is continuous andproportion to the temperature. The voltage representing the temperature is converted intoa digital representation which is fed to a digital controller that generates a digital valuecorresponding to the desired amount of heat. The digitized output representing the heat isconverted back to a voltage value which is continuous and is used to control a valve thatregulates the heat. An A/D converter converts the analogue voltage value representing thetemperature into a corresponding digital value for processing. A D/A converter convertsback the digital heat value to its corresponding continuous value for regulating the heater.CS302 – Digital Logic DesignVirtual University of Pakistan Page 11Figure 1.9 Digitally Controlled Industrial Heater UnitA/D and D/A converters are an important aspect of digital systems. These devicesserve as a bridge between the real and digital world allow the two to communicate andinteract together.Number Systems and CodesDecimal Number SystemThe decimal number system has ten unique digits 0, 1, 2, 3… 9. Using these singledigits, ten different values can be represented. Values greater than ten can be representedby using the same digits in different combinations. Thus ten is represented by the number10, two hundred seventy five is represented by 275 etc. Thus same set of numbers 0,12… 9 are repeated in a specific order to represent larger numbers.The decimal number system is a positional number system as the position of a digitrepresents its true magnitude. For example, 2 is less than 7, however 2 in 275 represents200, whereas 7 represents 70. The left most digit has the highest weight and the rightmost digit has the lowest weight. 275 can be written in the form of an expression in termsof the base value of the number system and weights.2 x 102 + 7 x 101 + 5 x 100 = 200 + 70 + 5 = 275where, 10 represents the base or radix102, 101, 100 represent the weights 100, 10 and 1 of the numbers 2, 7 and 5Fractions in Decimal Number SystemIn a Decimal Number System the fraction part is separated from the Integer part by adecimal point. The Integer part of a number is written on the left hand side of the decimalpoint. The Fraction part is written on the right side of the decimal point. The digits of theDigitalControllerTransducerA/DConverterD/AConverterVesselHeaterCS302 – Digital Logic DesignVirtual University of Pakistan Page 12Integer part on the left hand side of the decimal point have weights 100, 101, 102 etc.respectively starting from the digit to the immediate left of the decimal point and movingaway from the decimal point towards the most significant digit on the left hand side.Fractions in decimal number system are also represented in terms of the base value of thenumber system and weights. The weights of the fraction part are represented by 10-1, 10-2,10-3 etc. The weights decrease by a factor of 10 moving right of the decimal point. Thenumber 382.91 in terms of the base number and weights is represented as3 x 102 + 8 x 101 + 2 x 100 + 9 x 10-1 + 1 x 10-2 = 300 + 80 + 2 + 0.9 + 0.01 = 382.91Caveman number systemA number system discovered by archaeologists in a prehistoric cave indicates thatthe caveman used a number system that has 5 distinct shapes Σ, Δ, >, Ω and ↑.Furthermore it has been determined that the symbols Σ to ↑ represents the decimalequivalents 0 to 5 respectively.Centuries ago a caveman returning after a successful hunting expedition recordshis successful hunt on the cave wall by carving out the numbers Δ↑. What does thenumber Δ↑ represent? The table 1.1 indicates that the Caveman numbers Δ↑ representsdecimal number 9.Decimal Number Caveman Number Decimal Number Caveman Number0 Σ 10 >Σ1 Δ 11 >Δ2 > 12 >>3 Ω 13 >Ω4 ↑ 14 >↑5 ΔΣ 15 ΩΣ6 ΔΔ 16 ΩΔ7 Δ> 17 Ω>8 ΔΩ 18 ΩΩ9 Δ↑ 19 Ω↑20 ↑ΣTable 1.1 Decimal equivalents of the Caveman NumbersThe Caveman is using a Base-5 number system. A Base-5 number system has fiveunique symbols representing numbers 0 to 4. To represent numbers larger than 4, acombination of 2, 3, 4 or more combinations of Caveman numbers are used. Therefore, torepresent the decimal number 5, a two number combination of the Caveman numbersystem is used. The most significant digit is Δ which is equivalent to decimal 1. The leastsignificant digit is Σ which is equivalent to decimal 0. The five combinations ofCaveman numbers having the most significant digit Δ, represent decimal values 5 to 9respectively. This is similar to the Decimal Number system, where a 2-digit combinationCS302 – Digital Logic DesignVirtual University of Pakistan Page 13of numbers is used to represent values greater than 9. The most significant digit is set to 1and the least significant digit varies from 0 to 9 to represent the next 10 values after thelargest single decimal number digit 9.The Caveman number Δ↑ can be written in expression form based on the Basevalue 5 and weights 50, 51, 52 etc.= Δ x 51 + ↑ x 50 = Δ x 5 + ↑ x 1Replacing the Caveman numbers Δ and ↑ with equivalent decimal values in theexpression yields= Δ x 51 + ↑ x 50 = 1 x 5 + 4 x 1 = 9The number ΔΩ↑Σ in decimal is represented in expression form asΔ x 53 + Ω x 52 + ↑ x 51 + Σ x 50 = Δ x 125 + Ω x 25 + ↑ x 5 + Σ x 1Replacing the Caveman numbers with equivalent decimal values in the expression yields= (1) x 125 + (3) x 25 + (4) x 5 + (0) x 1 = 125 + 75 + 20 + 0 = 220Binary Number SystemThe Caveman Number system is a hypothetical number system introduced toexplain that number system other than the Decimal Number system can exist and can beused to represent and count numbers. Digital systems use a Binary number system.Binary as the name indicates is a Base-2 number system having only two numbers 0 and1. The Binary digit 0 or 1 is known as a 'Bit'. Table 1.2Decimal Number Binary Number Decimal Number Binary Number0 0 10 10101 1 11 10112 10 12 11003 11 13 11014 100 14 11105 101 15 11116 110 16 100007 111 17 100018 1000 18 100109 1001 19 1001120 10100Table 1.2 Decimal equivalents of Binary Number SystemCS302 – Digital Logic DesignVirtual University of Pakistan Page 14Counting in Binary Number system is similar to counting in Decimal or CavemanNumber systems. In a decimal Number system a value larger than 9 has to be representedby 2, 3, 4 or more digits. In the Caveman Number System a value larger than 4 has to berepresented by 2, 3, 4 or more digits of the Caveman Number System. Similarly, in theBinary Number System a Binary number larger than 1 has to be represented by 2, 3, 4 ormore binary digits.Any binary number comprising of Binary 0 and 1 can be easily represented interms of its decimal equivalent by writing the Binary Number in the form of anexpression using the Base value 2 and weights 20, 21, 22 etc.The number 100112 (the subscript 2 indicates that the number is a binary numberand not a decimal number ten thousand and eleven) can be rewritten in terms of theexpression100112 = (1 x 24) + (0 x 23) + (0 x 22) + (1 x 21) + (1 x 20)= (1 x 16) + (0 x 8) + (0 x 4) + (1 x 2) + (1 x 1)= 16 + 0 + 0 + 2 + 1= 19Fractions in Binary Number SystemIn a Decimal number system the Integer part and the Fraction part of a number areseparated by a decimal point. In a Binary Number System the Integer part and theFraction part of a Binary Number can be similarly represented separated by a decimalpoint. The Binary number 1011.1012 has an Integer part represented by 1011 and afraction part 101 separated by a decimal point. The subscript 2 indicates that the numberis a binary number and not a decimal number. The Binary number 1011.1012 can bewritten in terms of an expression using the Base value 2 and weights 23, 22, 21, 20, 2-1, 2-2and 2-3.1011.1012 = (1 x 23) + (0 x 22) + (1 x 21) + (1 x 20) + (1 x 2-1) + (0 x 2-2) + (1 x 2-3)= (1 x 8) + (0 x 4) + (1 x 2) + (1 x 1) + (1 x 1/2) + (0 x 1/4) + (1 x 1/8)= 8 + 0 + 2 + 1 + 0.5 + 0 + 0.125= 11.625Computers do handle numbers such as 11.625 that have an integer part and afraction part. However, it does not use the binary representation 1011.101. Such numbersare represented and used in Floating-Point Numbers notation which will be discussedlatter.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.