5. Trigger Implementation counter

Source: Internet
Author: User

Before we tell the door, relays, in fact, relays can have many aspects of the application, power can be made into electronic buzzer and bell. It sounds incredible what the relays have to do with these things. Relays are also called double-throw relays because there are two different outputs, one is power when the locking is closed, and the other is a reverse device. And here we are similar to the reverse connection, but we connect the input and output of the relay together, that is, to practice a circuit, so we found a very strange phenomenon, that is, when the closed switch, the metal Reed will continue to vibrate up and down, making a shrill beep, which makes a buzzer, put a small hammer on the metal reed , put a gong above it, and make a bell. We refer to this circuit also as an oscillator. The oscillator can form a periodic 0,1 alternating sequence, so the oscillator is also called a clock.

Feedback: The output of one door is connected to the input of another door.

Trigger: There are two stable states when the switch is disconnected.

Triggers can hold a bit of information, so for example, the multiple adder and counters mentioned below are used for triggers.

1.r-s Trigger: The key of this is reset and set, when R=1, S=0, q=0, when S=1, r=0, Q=1, when s=0,r=0, Q remains the original state, S=r=1, the state is forbidden. The purpose is to remember which of the inputs is 1.

2. Data end-Hold bit trigger: This is the predecessor of D flip-flop, and similar to the R-s trigger, the data end is only used to transfer data, hold the bit to save the previous data, when the hold bit is 0 o'clock, the data side of any input does not affect the output, when the hold bit is 1 o'clock, the data input is output. Changing the hold bit to a name called a clock is the D trigger.

Level trigger: When the hold bit input is a value, the trigger saves the data-side input value.

We call a latched trigger as a latch that combines multiple latches into a multi-bit latch, typically a 8-bit latch device. Can be used to implement multiple number additions.

If we introduce a clear 0-bit in the trigger, then we only need a row of switches, we can achieve multiple number of additions, the implementation process is as follows:

1. First zero the data in the latch.

2. Enter a number A, close the hold bit, allow to change the result. It must have been a a+0 at first.

3. Then enter the second number B, then it becomes a+b.

4. And so on, you can complete any number of additions.

With the level trigger, next we want to talk about edge triggering, edge triggering package appearance and level trigger is the same as the input and output are the same, but at the clock of 1 and 0 o'clock, the data side will not affect the output, here we introduce the D-edge trigger, he is the level two r-s trigger, When the clock signal changes from 0 to 1, the data end is transmitted to the output. When the clock changes from 1 to 0 o'clock the output does not change, so it can be said that the frequency of the clock jump is twice times the output jump, if the output as a clock input to another D-edge trigger, the frequency will be halved, this method is called frequency division. The following is a diagram of the results:

Clk:01010101

q1:00110011

q2:00001111

q3:00000000

Looking at each column from the bottom line, you can see that the first column is 0000, the second column is 0001, and the third column is 0010. This is the incremental process of our binary number, so this can be used as a counter. We call it a 8-bit line-wave timer.

There is also a more advanced counter that is "parallel counters". All outputs can be read at the same time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.