109 Flashcards

1
Q

What is a counter?

A

> They increase in value by 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How are counters built?

A

> With flip-flops

> A 4 bit counter requires 4 flip-flops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is a timer made? How are they applied?

A

> Using counters

> Increase on every clock cycle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can a timer be used to calculate the time passed?

A

> If we know the clock frequency then we can measure how many clocks have passed to work out time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a JK Flip-flop?

A

They are like a flip flop except they toggle the current value being stored

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the inputs and outputs of a JK flip-flop?

A
> J
> K
> Clk
> Q
> Q(NOT)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the truth table for a JK Flip-flop

A
CLK J K Q
   ^   0 0 Q(t-1)
   ^   0 1  0
   ^   1  0  1
   ^   1  1  [NOT] Q(t-1) It flips the value stored
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Synchronous counter and how is it implemented?

A

> This is a binary counter which increased based off the clock signal.
Made using JK Flip-flops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In a binary counter, when is the next bit flipped?

A

When all the previous bits are 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is the least significant bit clocked?

A

With the clock cycle input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is a Synchronous counter made from JK flip-flops and logic gates (for a 4 bit counter)?

A

> There are 4 JK flip-flops in a line
Each has the same clock signal as its input
JK1 has both its J and K inputs set at 1
The output of the JK1 goes into the J and K input for JK2
An AND gate is placed beside the JK2 with one of its input from the output of JK1 and the output of JK2.
The result of the AND gate goes into both the J and K of JK3
Another AND gate is placed beside JK3 with one of its inputs being the result of the first AND gate and the other from the output of JK3.
The result fo this second AND gate goes into both the J and K inputs of JK4
The outputs of each JK represent the bits of the counter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a good application of a counter?

A

> Frequency divider

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a frequency divider?

A

> This divides the frequency by 2^x

> This is good because we can make very accurate clocks using quartz crystals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How are quartz crystals divided with a frequency divider?

A

> They vibrate at 32,768Hz

> A frequency divider with 15 stages can produce a very accurate clock with a frequency of 1 Hz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How is the clock frequency increased?

A

> An internal phase-lock loop is used to multiply the base frequency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the issue with a high frequency clock counter?

A

A 32 bit counter is not enough for even a 10 MHz clock frequency and will not last long so a larger counter is needed

17
Q

What is a watchdog timer?

A

> This prevents a computer from becoming stuck and recover from a malfunction
This is a timer which counts clock cycles
When it overflows it resets the computer.
To stop it always resetting the computer program needs to continuously reset the clock to 0 (referred to as petting the dog)

18
Q

What is an important situation for a watchdog timer?

A

For flight essential computers in space probes

19
Q

What is a UART?

A

> Universal Asynchronous receiver transmitter

> Used to send data between two devices 1 bit at a time

20
Q

How is a UART synchronised and why?

A

> There is no clock speed between them
So both devices need to know the rate at which data is being transferred
Timers are used to send data between the devices at the correct times

21
Q

What is pulse width modulation?

A

> Turning on and off very quickly to control analogue devices
Used to digitally control the speed of motors

22
Q

What is the duty cycle?

A

The ratio of the time on and off for a PWM signal

23
Q

How is a duty cycle for PWM implemented?

A

> When the signal is high, a counter is used to count up to a number and turn off the signal.
Then it repeats over a standard amount of time

24
Q

What is used to control the times of a PWM signal?

A

The Match register

25
Q

What are the different times for a match register?

A

MR0 - How often the signal repeats

MR1…MRn - How long the signal is on for

26
Q

What is an RTC? What does it stand for?

A

> A real time clock

> A clock used to count the real time and date

27
Q

How is the RTC powered?

A

> It has a constant power supply even when the device is turned off
Uses a quartz crystal

28
Q

What is UNIX time?

A

> It is the number of seconds passed since the 1st January 1970
Uses a 32 bit counter

29
Q

What is the problem with UNIX time with a 32 bit counter?

A

> It will overflow in 2038 and so will not count from 1/01/1970
It is possible a 64 bit counter will be used instead