This preview shows page 1. Sign up to view the full content.
Unformatted text preview: r example, the 16bit binary number 1101 0111 0011 1100 is coded as $D73C hexadecimal. 8Bit Binary Counter
A logical extension of the 4bit binary counter is to higher data widths. Embedded controllers use an internal 8bit data bus, and modern microprocessors use 16 or 32bit data paths. The VI Binary8.vi demonstrates visually the binary counting sequence as a byte on eight LED indicators or as an 8bit timing diagram. Run this VI continuously to observe binary numbers from 0255. The timing diagram clearly shows how each stage divides the previous output by 2. The output frequencies are f/2, f/4, f/8, f/16, f/32, f/64, f/128, and f/256 for the output stages Q0...Q7. Here, f is the clock frequency. Binary counters need to be reset (all bits 0) or set (all bits 1) for various operations. The truth table for the JK flipflop shown above has direct inputs that provide this function. The clocked logic can occur whenever the reset and set inputs are pulled high. A 0 on either the Set or Clear input forces the output to a 1 or 0, respectively. These operations are exclusive, hence the (00) state is disallowed. The VI Bin8_Reset.vi provides a clear function for the 8bit binary counter. Load and run this VI continuously. By pressing the Reset button, the binary counter is cleared. This operation is useful in applications for odd length counters and in designing analogtodigital converters. LabVIEW Challenge
Design a twodigit binary counter, which counts from 00 to 99. Summary
Binary counters are a fundamental component in digital electronic circuits. They are used in all forms of modulon counters, in the generation of harmonic clock subfrequencies, and in many higher order functions such as digitaltoanalog and analogtodigital devices. National Instruments Corporation 65 Fundamentals of Digital Electronics Lab 6 JK MasterSlave FlipFlop Lab 6 Library VIs (Listed in the Order Presented) Binary1.vi (Divide by 2 binary counter) Binary2.vi (Divide by 4 binary counter) Binary4.vi (Divide by 16 binary counter with logic traces) Binary8.vi (Divide by 256 binary counter with logic traces) Bin8_Reset.vi (8bit binary counter with external reset button) FlipFlop.vi (T flipflop subVI used in above programs) Fundamentals of Digital Electronics 66 National Instruments Corporation Lab 7 DigitaltoAnalog Converter
The digitaltoanalog converter, known as the D/A converter (read as DtoA converter) or the DAC, is a major interface circuit that forms the bridge between the analog and digital worlds. DACs are the core of many circuits and instruments, including digital voltmeters, plotters, oscilloscope displays, and many computercontrolled devices. This chapter examines the digitaltoanalog converter, several variations, and how it is used for waveform generation. What is a DAC?
A DAC is an electronic component that converts digital logic levels into an analog voltage. The output of a DAC is just the sum of all the input bits weighted in a particular manner:
DAC = w b
i=0 i i where wi is a weighting factor, bi is the bit value (1 or 0), and i is the index of the bit number. In the case of a binary weighting scheme, wi = 2i, the complete expression for an 8bit DAC is written as DAC = 128 b7 + 64 b6 + 32 b5 + 16 b4 + 8 b3 + 4 b2 + 2 b1+ 1 b0 National Instruments Corporation 71 Fundamentals of Digital Electronics Lab 7 DigitaltoAnalog Converter Figure 71. LabVIEW Simulation of an 8Bit DAC The above simulation, DAC.vi demonstrates the conversion process. On the front panel, eight Boolean switches set the input bits b0 through b7. Eight LED indicators display the binary value of the input byte when the simulation is run. The analog output is displayed as a numeric indicator. The diagram panel displays the LabVIEW algorithm shown below for the 8bit converter. Figure 72. LabVIEW VI for 8Bit DAC.vi The simulation uses two input multiply and add functions to generate the DAC sum. Note the BooleantoReal icon on the block diagram, which Fundamentals of Digital Electronics 72 National Instruments Corporation Lab 7 DigitaltoAnalog Converter simulates in a very real way the bridging of the binary (Boolean levels) into the analog (numeric) value. Load and run DAC.vi to observe the relationship between the binary codes and their numeric equivalent. DAC.vi is also a subVI, so it can be used in other programs to convert any 8bit digital signal into the decimal equivalent value. To see how a DAC might be used, consider the simulation of an 8bit add instruction inside a microcomputer chip. ALU Simulator
The arithmetic and logic unit (ALU) is responsible for all arithmetic and logic operations occurring inside the central processing unit (CPU) of a computer chip. Consider the add instruction ADD R1,R2 which adds the contents of Register 1 with the contents of Register 2 and stores the sum into an accumulator. Eight Boolean switches and displays simulate the 8bit registers R1 and R2. Nine LED indicators show the value of the accumulator and any overflow in the carry bit. Three...
View Full
Document
 Spring '09
 s

Click to edit the document details