Designing of 8 BIT Arithmetic and Logical Unit and implementing on Xilinx Vertex 4 FPGA 1. DESIGNING OF 8 BIT ALU AND IMPLEMENTING ON XILINX VERTEX 4 FPGA SUBMITTED BY PREETI TAKHAR PRIYANKA RAJPAL. VHDL was originally developed at the behest of the U.S Department of Defense in order to document the behavior of the ASICs that supplier companies were including in equipment. The idea of being able to simulate the. Module Topic Project Module 1: Getting Prepared : Purchasing your hardware, downloading and installing the development tools. Module 2: Your first design : Wiring switches to LEDs and downloading your design (First Arithmetic core n done,FPGA provenWishBone Compliant: NoLicense: GPLDescriptionThis is 8-bit microprocessor with 5 instructions. It is based on 8080 architecture. This architecture called SAP for Simple-As-Possible computer. This means that you need to build a large comparator to match the results. It would be far better to add one more bit to the counter, then load the value. Nanocounter is an accurate frequency counter using an FPGA, STM3. Nanocounter is an accurate frequency counter using an FPGA, STM3. Posted on Feb 2. 1, 2. Here we have a good example of how a requirement for a simple tool spirals out of control and spawns a project that takes months to complete and ends up dwarfing the project that it was originally expected to facilitate. You see, some time ago I was fiddling around with a project, something to do with data logging, probably, I’ve actually forgotten what I was up to. Said project would have used an MCU to acquire and timestamp data over an extended period of time and I quickly realised that the oscillators and quartz crystals used to generate the clock tree inside an MCU are not accurate enough to track wall- clock time over extended periods. If you’ve been thinking about playing around with FPGAs and/or are interested in CPU design, . Normally we’d wait until the whole series is. At the bottom of the accuracy pile are the built- in oscillators that you get inside MCUs that enable crystal- free operation. For example, the high- speed internal (HSI) clock in an STM3. F0. 72 has a factory trimmed accuracy range of . The HSI operates at 8. MHz so that means . Over the course of an hour this could mean a drift of more than 1. What about the external crystals? Well they’re much better with a typical tolerance of . As long as I’m operating at a reasonably constant temperature then my data logger could apply a periodic correction to my timekeeping clock so that I’d have very accurate timings over a period of days. But how do I measure the accuracy of the crystal that’s clocking my MCU? The answer is with a frequency counter. Here we have a good example of how a requirement for a simple tool spirals out of control and spawns a project that takes months to complete and ends up dwarfing the project that it was originally expected to facilitate. Hi there, Im just wondering where I can get the VHDL code for Rs-232 receiver and transmitter design? Im planning to use this code to implement. Cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v1.70 (July 1, 2016) Hosted at http:// since August 2006, cloc began the transition. There’s a wide range of counters out there, from the cheapest bare- PCB options to the high- end laboratory grade equipment from the likes of HP (I hold out the hope that one day they’ll drop the comedy names and actually be HP again). Opposite ends of the product spectrum. Occupying the middle ground there’s the no- name VC3. Simple mathematics then tell you what the unknown frequency is, plus or minus an error term. There are a number of different methods for doing this, let’s take a look at them. For the remainder of this article we will refer to the frequency being measured as the sample frequency and the accurate timebase as the reference frequency. Direct frequency measurement. The direct frequency method counts the number of edges of the sample frequency observed during a fixed number of periods of the reference frequency. The formula for calculating the sample frequency is straightforward. N is the count, period is in Hz. From the above formula you can see that if the reference frequency is 1. Hz then the measurement implementation becomes really simple as the number of sample counts observed is the sample frequency and could be output directly to an attached display. Because the time period is linked to the reference frequency the error term for this method is . There is an excellent and very readable PDF available online that describes this method. Click here to read it. The instrument receives a trigger to start counting pulses but does not do so until the next rising edge of the sample clock. It then starts counting both the reference and sample clock edges using two counters. After the desired time period has come to an end the instrument stops counting at the next rising edge of the sample counter. The relationship between the time period, the two counters and their associated frequencies is given by the following ratios: s and ref are the sample and reference signals. Discarding the period and re- arranging the remaining ratios gives us the following formula for calculating the sample frequency: The advantage of this method is that the error term is . This would cover the range of MCU crystals that I’d want to measure. Onboard accurate, but cost effective reference with the option to feed in an external reference clock source. Advanced options including data logging, charting and calibration of the onboard reference. That should do for starters, let’s see how I get on. This project will call upon a large number of engineering disciplines including circuit design, PCB layout, SMD reflow, FPGA design, C++ programming and java android programming so I should be in for a fun time. I’ve made the decision to use the equal precision counting method so let’s see how that looks in a block diagram of the whole system. The input stage. My design should be able to accept a wide range of input signals including sine and square waves that are DC or AC coupled and range over the common voltages used to drive clock signals. The job of accepting these signals and transforming them into a standard LVCMOS square wave that I can feed to the FPGA falls to the input stage or analog front end. I’ll need to instantiate my input stage design twice, once for the sample clock input and again for the external reference clock input. The PLLThe onboard reference clock will be a 1. MHz oscillator and the external reference input, if connected, is expected to be of the same frequency. The PLL is used to multiply the 1. MHz input up to the much higher reference frequency that is provided as an input to the FPGA. The actual reference frequency will be limited by the counting speed of the FPGA as well as the limits of the selected PLL. The PLL used for this design will have to accept multiple inputs and have very good jitter characteristics if I am to maintain my goal of very high accuracy. The FPGAHere’s the business end of the system. An FPGA is capable of counting extremely quickly, in parallel, and on a cycle- accurate basis. While even the most basic MCUs have edge- triggered interrupts they cannot react quickly enough to count at the speed that an FPGA can achieve. The MCUThe MCU marshalls all the other components in the system. It communicates with the user and the display, programs the FPGA on startup and holds system calibration data. The circuit design. So, considering all that I’ve learned so far I came up with a circuit design for the complete system. This isn’t going to be a bargain- basement design. My requirement for high accuracy means that top quality components from the likes of Linear Technology and Analog Devices are going to be making an appearance on this board. Click for PDFThe USB port and power entry. Power is supplied through a USB mini B socket. The potentially noisy 5. V line is smoothed using capacitors and a ferrite bead. I know from my previous experience with FPGAs that they can be rather power hungry. If the power consumption goes above 5. A then I’ll need to restrict usage to USB 3 ports or charging plugs. I’ve opted to hook up the D+ and D- data lines even though I may not use them in the final design. The USBLC6 ESD protection device from ST Micro provides protection against spikes on the line that may occur during the insertion and removal of the plug. The sample and reference input stages. The input stage is based around the LTC6. Linear Technology. This device is a very low noise buffer and signal distribution device that can accept any sine or logic level less than 2. Vp- p and output a fixed logical level. It’s available in 4 separate versions that can output LVPECL, LVDS or CMOS logic levels. I’ve selected the LTC6. IMS- 3 variant that has CMOS output levels and costs about . The capacitor C7 AC couples the input signal before it passes through the transformer, T2 and the schottky diodes provide voltage limiting to the inputs of the LTC6. That’s a very brief summary of the operation. I’d encourage you to read DN5. Linear Tech’s engineers. The LTC6. 95. 7 comes with 3 selectable narrowband filter options of 5. MHz, 1. 60. MHz and 5. MHz. The best choice will depend on the input signal so I’ve opted to connect the filter pins to MCU GPIO pins so I can offer the choice of filter through the user interface. LP5. 90. 7I’m powering the LTC6. LP5. 90. 7 ultra- low noise LDO regulator from Texas Instruments. The input stage in the illustration is the sample input. The external reference input is basically identical. The only difference is that I’ve connected the LTC6. MCU GPIO pin so that I can shutdown the output when the onboard reference is being used. The onboard reference oscillator. The stability and tolerance of the reference clock is key to the accuracy of the frequency measurements. Clearly I need something more accurate than the crystals that I seek to measure which means in practice that I need to use either a temperature compensated oscillator (TCXO) or an ovenised oscillator (OCXO). The price of these devices is in direct proportion to their stability and they get quite expensive really quickly. Since I’m providing the ability to supply an external reference when exceptional accuracy is required I’ve decided to go for a reasonably high end TCXO, the Connor Winfield M1. F, which has a stability of . More stable TCXOs exist, and then there are the very stable OCXOs but they’re beyond the scope of my requirements for this article. Cheap used OCXOs and VCOCXOs abound on ebay but I’d be very wary of them since the reason they’ve been decommissioned is that their age means that they could have drifted out of spec and for the VCOCXOs that means they could have drifted out of the range of voltage correction. Connor Winfield M1. FThe TCXO works by applying compensation to the output frequency based on a curve of temperature vs. A TCXO will still drift with change in temperature but it will do so at a much lower rate than a standard crystal (we’ll have some fun demonstrating this in the videos that accompany this article). Better immunity to ambient temperature changes can be had with an OCXO but they’re really expensive from the usual distributors —. The datasheet for the M1. F. Deviation from this value could alter the output frequency by up to 2. F. I consulted the datasheet for my FPGA and found an input capacitance range of 3- 1. F for input pins with no typical value specified. Hoping that it’ll be somewhere around 5p. F I added C2. 5 to the output to provide the additional load. Assuming your count variable is an integer: while (i < 4. Do something. i : = count + 1. Edit: I haven't tested the code above, you might be unable to change the variable count inside the loop, I'm not sure. Maybe the first solution is the best one. It is not possible to have a for loop with a step different then 1. You are not even allowed to change it inside the for, like this: -- THIS WILL NOT WORK. Do Something. i : = i + 1. This will NOT increment the loop index by 1. And finally, for steps of 2 or 3 you might use nested for's. But anyway, What are you trying to accomplish? VHDL is a low- level hardware description language, you should be able to achieve whatever you are trying to without fancy for loops.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2016
Categories |