IA: 1P3: Digital Circuits and Information Processing Flashcards

(233 cards)

1
Q

What is combinational logic?

A

Output is dependent only on a combination of the inputs

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

What is sequential logic?

A

Output is dependent on a combination of the inputs and previous outputs (memory)

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

How are computers build from semiconductors?

A
  1. Semiconductors are used to build transistors
  2. Transistors are used to build logic gates
  3. Logic gates are used to build logic functions
  4. Logic is used to build Flip-flop bistables
  5. Flip-flops are used to build counters and sequencers
  6. Sequencers are used to build microprocessors
  7. Microprocessors are used to build computers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a variable that can only take 2 values called?

A
  • Logic variable
  • Binary variable
  • Boolean variable

All names for the same thing

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

What are the 2 values a boolean variable can take?

A
  • TRUE or FALSE
  • ON or OFF
  • high or low
  • 1 or 0

etc etc

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

What are the 2 states of a logic variable represented by in an electronic circuit?

A

Voltage levels, i.e. high voltage for 1 and low voltage for 0

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

What can be used to denote NOT?

A

A bar above the symbol,

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

What is a logic / digital circuit?

A

Electronic circuits that have logic signals as their inputs and outputs

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

What are logic gates?

A

Basic logic / digital circutis with one or more inputs, and one output. They represent a single basic function.

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

What is the graphical symbol for a NOT gate?

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

What is the input-output map for a NOT gate

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

What is the boolean representation of a NOT gate?

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

What is an inverter?

A

A NOT gate

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

What does a circle on the output of a gate mean?

A

It always means that it is an inverting output

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

What is the graphical symbol for an AND gate?

A

This is a 2 input AND gate, more than 2 inputs is possible

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

What is the input-output map for an AND gate?

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

What is the boolean representation for an AND gate?

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

What is the graphical symbol for an OR gate?

A

This is a 2-input OR gate, more than 2 inputs is possible

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

What is the input-output map of an OR gate?

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

What is the boolean representation of an OR gate?

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

What does a NOT gate do?

A

The output is TRUE only if the input is FALSE - it “inverts” the input

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

What does an AND gate do?

A

The output is TRUE if and only if both of the inputs are TRUE

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

What does an OR gate do?

A

The output is TRUE if any (or all) of the inputs are TRUE

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

What does a XOR gate do?

A

The output is TRUE if an odd number of inputs are TRUE

It is an EXCLUSIVE OR gate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the graphical symbol for a XOR gate?
They are usually 2-input
26
What is the input-output map for a XOR gate?
27
What is the boolean representation of a XOR gate?
28
What does a NAND gate do?
It is a NOT AND gate, it is like having a NOT gate after the output of an AND gate. The output is FALSE if and only if both of the inputs are TRUE
29
What is the graphical symbol for a NAND gate?
## Footnote Note: the circle on the output of the gate denotes an inverter
30
What is the input-output map for a NAND gate?
31
What is the boolean representation of a NAND gate?
32
What is a NOR gate?
It is a NOT OR gate, it is like having a NOT gate on the output of the OR gate. The output is TRUE if and only if both of the inputs are FALSE
33
What is the graphical symbol for a NOR gate?
## Footnote Note: the circle on the output of the gate denotes an inverter
34
What is the input-output map for a NOR gate?
35
What is the boolean representation of a NOR gate?
36
How would you solve this setup graphically?
1. For the resistor: Vᵣ = IR 2. For the "thing": Vₜ = 10 - Vᵣ 3. Plot the line for the resistor on an I-R graph 4. Plot the characteristic of the "thing" but flip it horizontally, with it touching the x-axis at 10V. By doing this you make it so "Vₜ = 10 - Vᵣ" 5. The operating point is where both lines intersect ## Footnote Rule of thumb: Whatever is connected to ground you just plot normally, whatever is connected to the supply rail you flop horizontally
37
When does an enhancement mode NMOSFET start conducting?
When Vgs reaches a threshold voltage (Vₜ)
38
What is the circuit to implement an inverter using an NMOS FET?
39
If the input-output characteristics of the gate are far from the ideal we originally wanted, how can we still make the logic gate work?
You can define voltage levels for the logic variables. For example: * Voltage > 9V is logic 1 * Voltage < 2V is logic 0 The gate will work if: * Vᵢₙ > 9V ⟹ Vₒᵤₜ < 2V * Vᵢₙ < 2V ⟹ Vₒᵤₜ > 9V
40
What is a trace table?
A tool used in digital circuits to help track the values of logic variables step by step through the circuit.
41
What sort of gate is this?
NOR gate
42
What sort of gate is this?
NAND gate
43
What are the benefits of using gates?
When you have to implement a complicated logic function you don't have to design a special transistor circuit to provide the functionality. Instead you just but an integrated circuit (or chip) that provides the appropriate gates
44
What limits the speed of NMOS logic?
Stray capacitance: The output of each gate is connected by a length of metal track to the input of the next. This has capacitance to ground. Therefore the circuit model is modified by connecting a capacitor between Vₒᵤₜ and ground. This means that each time the input switches, the output does not switch immediately - there is a time delay.
45
Why may a FET be used to replace the resistor?
Transistors are far smaller than resistors, therefore by using a FET you save a lot of space on the silicon chip. This allows the logic gate to be about 100x smaller (and cheaper!)
46
How can you make a MOSFET behave like a resistor?
You can make a MOSFET behave (almost) like a resistor by connecting the gate to the drain. Thus Vgs = Vds. This does not create a completely linear line when plotting Ids against Vds, so it will not behave exactly the same as a resistor, however it is fairly close.
47
What does the NMOS inverter look like when a FET has been used to reduce its size?
48
What is the problem with NMOS logic?
Power consumption. NMOS's use resistors/NMOS transistors which dissipate large amounts of energy even when idle. Therefore NMOS circuits consume a lot of energy even when not switching as there is always a current flowing. This leads to a high energy usage and heat generation in larger circuits.
49
What is CMOS logic?
Complementary MOS. CMOS logic uses both NMOSFETS and PMOSFETS. It tackles the issue of power dissipation in NMOS logic.
50
Functionally how does a PMOSFET differ from an NMOSFET?
A PMOSFET is essentially an NMOSFET with all the polarities reversed: ## Footnote Note: The arrow direction on the PMOS (opposite to NMOS)
51
When is a PMOS on?
When Vgs is negative
52
What is a CMOS inverter?
53
Why does CMOS not struggle from the same power dissipation issues as NMOS?
In a CMOS circuit at a given state, only one of the PMOS and NMOS are ever on at a time - one of them is off at all times. The circuit only draws current momentarily during transitions from one state to another (when both transistors are momentarily on at the same time). Therefore there is no static power dissipation.
54
If Vᵢₙ was 6V, how would you choose suitable characteristic curves for the NMOS and PMOS to solve it graphically?
* Vgs for the NMOS would be 4V, so you must choose the Vgs = 4V characteristic curve and plot it. * Vgs for the PMOS would be -6V, so you must choose the Vgs = -6V characteristic curve and then **flip it horizontally** (as it is connected to the supply rail) and then plot it
55
What does the diagram for power consumption look like for a CMOS inverter?
Neither high or low state dissipate power. Power is only dissipated when the states are switched.
56
What type of CMOS logic gate is this? ## Footnote * Be careful whether they are PMOS or NMOS * Use a trace table to determine what the gate does
NAND gate
57
What are the 4 types of logic families?
* NMOS (N-channel MOSFET) * CMOS (Complementary MOSFET) * TTL (Transistor-Transistor Logic) * ECL (Emitter Coupled Logic)
58
What is important in combinational logic design?
* Try to minimise the number of gates being used. This can lead to smaller chips and lower costs. * You must also be able to manipulate the expressions to use only gates of certain types if there is a limitation on the types of gates - some gates may be readily available and cheap.
59
What is commutation in boolean algebra?
60
What is association in boolean algebra?
61
What is distribution in boolean algebra?
## Footnote Note the bottom one in particular (unique to boolean algebra)
62
What is absorption in boolean algebra?
63
What are the rules with OR in boolean algebra?
64
What are the rules with AND in boolean algebra?
65
Does AND or OR take precedence in boolean algebra?
AND
66
What is meant by "every boolean law has a dual"?
Any valid statement is also valid when: ## Footnote ONLY valid when all 4 of these changes are made simultaneously
67
What is a useful technique for simplifying a boolean expression?
Expand each term until it includes one instance of each variable (or its compliment). This may then make it possible to simplify the expression by cancelling terms in the expanded form
68
What is De Morgan's theorem?
In a simple expression you can change all the operators from OR to AND (and vice versa) provided that you put a bar over each term individually and a further bar over the whole expression.
69
How can you turn a 2 input NAND gate into an inverter?
Connect the inputs
70
How can you turn a 2 input NOR gate into an inverter?
Connect the inputs
71
What are the 2 standard boolean forms?
* Sum of Products (SOP) * Product of Sums (POS) It can be difficult to convert between SOP and POS by algebraic manipulation
72
How can you obtain a Sum of Products (SOP)?
It is easiest to write down an expression for what you want directly
73
How can you obtain a Product of Sums (POS)?
It is easiest to write down an expression for the inverse of what you want and then use De Morgan's theorem and an inversion to obtain what you want.
74
What is VHDL?
A hardware description language used to describe systems.
75
What does VHDL stand for?
**V** = Very high speed integrated circuits **H** = Hardware **D** = Description **L** = Language
76
What is the structure of VHDL?
* Interface * Architecture Specification
77
How do you write "equal to" in VHDL?
<=
78
What is the VHDL definition of an inverter?
79
What is the VHDL definition of a 3 input NOR gate?
80
How can you use a logic gate in a larger design with VHDL?
81
How can you express this circuit in VHDL?
82
What is a karnaugh map?
A rectangular array of cells. Each possible state of the input variables corresponds uniquelt to one of the cells, and in the cell we write the corresponding output state. They are a powerful visual tool for carrying out simplification and manipulation of logic expressions with up to 5 input variables
83
What is important to remember when making the Karnaugh map?
**The pattern of high and low inputs.** i.e. 00, 01, 11, 10
84
Map the following expression on a Karnaugh map:
85
How can you use a Karnaugh map for circuit design using NAND gates?
* Write down the simplest sum-of-products expression for the output from the Karnaugh map * Use De Morgans theorem to convert this to an expression using NAND gates
86
How can you use a Karnaugh map for circuit design using NOR gates?
* Use the Karnaugh map to write down the simplest sum-of-products expression for the inverse of the output. This involves finding terms to cover the blanks between the boxes filled with ones * Use De Morgan's theorem to convert this to an expression using NOR gates.
87
Previously when using a Karnaugh map the rule has been to map the 1's to produce a simple NAND circuit or map the 0's to produce a simple NOR circuit. What is an alternative way of doing this?
Map the opposite way and then use a final inverter gate to change the output back again.
88
Are Karnaugh map's only available for 4 input variables?
No they can be used for up to 5 input variables
88
What is a "Don't care state" on a Karnaugh map?
For some output states, a certain combination of input variables may not matter. These are known as "Don't care states" and are marked with an **X** on the Karnaugh map. They can be chosedn to be 0 or 1, whichever helps to produce the simplest logic.
89
What is a static hazard?
A static hazard is when a signal undergoes a momentary transition when it is supposed to remain unchanged.
90
What is a dynamic hazard?
A dynamic hazard is when a signla changes more than once when it supposed to change just once.
91
Explain how a static hazard can occur (use static 1-hazard as an example)
92
How can you remove a static 1-hazard?
Fix a static 1-hazard by drawing the Karnaugh map of the output concerned. Make sure all the sum-of-products terms overlap.
93
How do you remove a static 0-hazard?
Fix a static 0-hazard by drawing the Karnaugh map of the inverse of the output concerned. Make sure all the sum-of-products terms representing the inverse overlap.
94
How do you remove a dynamic hazard?
Fix dynamic hazards by redesigning the circuit to simplify the logic
95
What is unit distance code?
A type of binary code in which only one bit changes between two successive values
96
How can you use Karnaugh map to produce a unit distance code?
As you move from a cell to its neighbour in a Karnaugh map only one variable changes. Because the map wraps round this is also true when moving from top to bottom and from far left to far right. This property can be used to produce a code in which only one bit changes at a time.5
97
What is Gray code?
A binary numbering system where two consecutive values differ by only one bit (a type of unit distance code).
98
Why can a unit distance code be important?
In regular binary counting (e.g. 0111 to 1000), multiple bits can change at once. If a signal is delayed or misread during a transition, it can cause a hazard (e.g. between 0111 and 1000 the output may momentarily be 1111). By using a unit distance code the chance of these hazards occuring is reduced.
99
What are 4 examples of number systems?
* Binary - base 2 * Octal - base 8 * Decimal - base 10 * Hexadecimal - base 16
100
Explain binary numbers.
Binary is base 2. Each digit is either 1 or 0.
101
What is a bit?
A binary digit
102
What is a byte?
a storage location for an 8 bit binary number
103
In computers how long are binary numbers?
8 bits (one byte)
104
What numbers can a byte store?
* **Unsigned byte** (positive numbers only): It can store numbers from **0 to 255** (2⁸ - 1) * **Signed byte** (can store positive and negative numbers): It can store numbers from **-128 to +127**.
105
What is the most significant bit (MSB)?
It’s the leftmost bit in a binary number. It holds the highest place value.
106
What is the least significant bit (LSB)?
It's the rightmost bit in a binary number. It holds the lowest place value.
107
How do you convert from decimal to binary?
Use the remainders from successive division by 2. Read upwards from MSB to LSB.
108
Explain the octal number system:
Octal is base 8. Each digit can be one of 8 numbers, 0-7.
109
How can you convert from decimal to octal?
Use the remainders from successive division by 8. Read upwards from MSB to LSB.
110
How can you convert from binary to octal?
Divide the binary number into 3-bit groups and work out the octal digit to represent each group.
111
What is the hexadecimal number system?
Hexadecimal is base 16. Each digit can be one of 16 **symbols**, 0-9 and then special symbols for 10-15.
112
What symbols are used to represent the digits 10-15 in hexadecimal?
113
What is 42₁₀ in hexadecimal?
2A₁₆
114
How do you indicate a number is hexadecimal? | Use 89₁₀ as an example
* 59**₁₆** * 59**ₕ** * **$**59 * **0x**59
115
How do you convert from decimal to hex?
Use successive division by 16, reading the remainders upwards from MSB to LSB
116
How do you convert from binary to hex (or the otherway round)?
Divide the binary number into **four-bit groups** and work out the hex digit to represent each group.
117
How can you represent positive and negative numbers (signed numbers) in binary?
We use a strategy called 2's complement. In this form: * The MSB for all positive numbers is zero * The MSB for all negative numbers is 1
118
How can you read a signed binary number?
Look at the first digit of the binary number: * If this is zero, then it is a positive number. In this case you can read it off/convert it to decimal as you would an unsigned binary number. * If this is one, then it is a negative number. In this case you must first reverse the 2's complement. To do this you must invert all the bits and then add 1. Read this off like a normal binary number - this is the magnitude of the number. The final number is the the negative of the magnitude.
119
How can you change the sign of a 2's complement number (i.e. change a negative to a positive or a positive to a negative)?
Invert all the bits and then add one.
120
How does addition (and subtraction) work with 2's complement?
When adding 2 signed 8 bit binary numbers (in 2's complement form), we can use normal binary addition. For subtraction we simply add the 2's complement negative version of the number. * Perform the addition as usual * Ignore the carry out of the 8th bit (carry bit) - we are only concerned with 8 bits. * The result should be interpreted as a signed 8-bit number (-128 to 127)
121
How can you detect if there has been overflow in binary arithmetic?
* **For unsigned binary arithmetic**: If the carry bit is 1, then there was a carry out from the MSB. Therefore if the carry bit is 1 then there has been an overflow. * **For signed binary arithmetic**: Overflow occurs if the carry into the MSB ≠ carry out of the MSB.
122
What does the plot of signed 2's complement 8 bit numbers against unsigned 8 bit numbers look like?
123
What is the sign and magnitude representation of a signed binary number and why is it rarely used?
The MSB indicates the sign (0 ⟹ +, 1 ⟹ -). The remaining 7 bits contain the magnitude. It is not commonly used as: * We will have 2 0's (-0 and +0) * Separate circuits are required to add and subtract numbers
124
What is binary coded decimal (BCD)?
**BCD is when each decimal bit is coded into a 4-bit group.** It is not an efficient way of storing numbers, but is easy to code and decode.
125
What are Alphanumeric Character Codes?
Alphanumeric character codes are numeric representations of letters (A-Z, a-z), digits (0-9), and sometimes symbols that are used by computers to store and process text. Examples include ASCII and Unicode.
126
What is ASCII?
It is the "American Standard Code for Information Interchange". It is a very commonly used Alphanumeric Character Code system. The standard version is a 7 bit code with the remaining but set to zero or used for parity. It includes 32 "control codes". The rest of the numbers are for lower case letters, upper case letters, numbers, and punctuation. The extended version of ASCII uses all 8 bits to provide 128 additional graphics characters.
127
What is unicode?
It is a 16 bit alphanumeric character code system. It includes all the same features as extended ASCII but also Covers ALL characters in every language, emojis, and mathematical symbols.
128
What is parity and how does it work?
Parity is the simplest method for error detection coding when transferring binary data through an imperfect data channel. A parity bit is added as to ensure there is always an even number of 1's in the byte. If the byte has an odd number of 1s the parity bit is set to 1 to make it even, and if the byte has an even number of 1s the parity bit is set to 0 so that there are still an even number of 1s. Once the byte has been transferred through the channel, we count the number of bits that are on in each number, accepting any that have an even number and rejecting any that have an odd number. This allows you to detect 1-bit errors.
129
What is the limitation of parity?
It can only detect 1-bit errors, more serious errors may go undetected
130
What is a flip flop?
A bistable
131
What is a bistable?
A circuit which has 2 stable internal states and can remain in either state indefinitely until an external input causes it to switch to the other state.
132
How is are D-type latches and JK bistables built?
* We start with the set-reset (SR) bistable * A gated-SR bistable is built using an SR bistable * A master-slave bistable is built using two gated-SR bistables * A D-type latch is built from a master-slave bistable * A JK bistable is built from a master-slave bistable
133
What is the structure of a Set-Reset (SR) bistable?
134
How does a Set-Reset (SR) bistable work?
**Inputs:** S (Set), R (Reset) **Outputs:** Q1 and Q2 **Behaviour:** * S = 1, R = 0: Sets Q1 = 1, Q2 = 0 * S = 0, R = 1: Resets Q1 = 0, Q2 = 1 * S = R = 0: Retains previous state (memory) * S = R = 1: Invalid condition **Operation:** * S will turn Q₁ on and Q₂ off. They will stay at this state even if S is turned off. * Until R turns on (RESET event, Q₁ = 0 Q₂ = 1) * R turns Q₂ on and Q₁ off. They will stay at this state even if R turns off. * Until S turns on (SET event, Q₁ = 1 Q₂ = 0) We therefore have memory. The circuit state depends not onlt on the current values of S and R but also on their values in the past.
135
What is the state diagram of the SR bistable?
The complete operation of the bistable can be described using the below state diagram: ## Footnote **Note: S = R = 1 is not allowed, it is invalid**
136
What is contact debouncing and how can it be achieved?
When mechanical switches are pressed they can bounce causing brief, unintended on/off pulses. Unless debounced, when you click a switch once it may be read as many presses due to bouncing. This can be seen in the graphs for A and B below. Contact debouncing is the process of removing these unwanted bounces, ensuring a clean digital transition. This can be achieved by using an SR bistable, when the switch is pressed it will set/reset the bistable placing it in one of its 2 stable states. Because an SR bistable retains its state until explicitly changed, it ignores the rapid fluctuations caused by bouncing. The output remains steady, switching only when the switch is intentionally pressed again to trigger the opposite state.
137
What is a gated SR bistable?
138
How does a gated SR bistable work?
It is the same as an SR bistable, however it introduces a gate signal (G) which only allows the bistable to change state when G is high (due to the AND gate). This can be used for synchronous control of state changes as the gate signal could be set to a clock. This would allow for accurate timing of output changes for corresponding SR inputs.
139
What is a Master-Slave bistable?
A Master-Slave bistable is composed of two gated SR bistables. **The outputs of a Master-Slave bistable are always logical opposites.**
140
How does a Master-Slave bistable work?
The output of one of the gated SR bistables is connected as the input to the second gated SR bistable (Q1 to S and Q2 to R). A clock is passed directly to the second bistable and is passed through a NOT gate to the first bistable. Therefore: **When the clock is low:** The first (master) is sensitive to input signals **When the clock rises:** The second (slave) is sensitive to its inputs i.e. the outputs of the first bistable This ensures changes only occur on a clock input **The outputs of a Master-Slave bistable are always logical opposites.**
141
What is the symbol for the Master-Slave bistable?
142
How can asynchronous inputs be implements in a master-slave bistable?
Asynchronous inputs can be used for immediate state control - independent of the clock * S&R are both gated. The inputs are both dependent on the clock signal - synchronous to CLK * **PR** and **CLR** are not gated - asynchronous They are active low: * When PRESET is low, Q goes high and Q *bar* goes low * When CLEAR goes low, Q *bar* goes high and Q goes low
143
What is a D-type latch?
Input data replaces S and R in a master-slave bistable. On the clock edge (as the clock goes high) the output (Q) gains the value of D. It is useful for retrievel of signals. ## Footnote The illegal state of S = R = 1 is eliminated by forcing S = not R. Thus a single "input data" replaces both
144
What is a JK Bistable?
A JK bistable is a type of edge-triggered flip-flop that is a refined version of the SR bistable, designed to avoid the invalid state of S = R = 1. The case of the inputs (J and K) both being 1 is now a useful input.
145
How is a JK Bistable built?
* Start with a simple SR bistable * Add gate input: bistable can only change state when the gate is high * Put two SR bistables together: create master-slave bistable. Output only changes when clock input rises (positively edge triggered) * Add asynchronous inputs: preset and clear * **Add AND gates to prevent S = R = 1 at input to first SR bistable** of master-slave pair. The inputs to these 2 AND gates are J and output *bar* and K and the output. Create JK bistable.
146
What is the operation of a JK bistable?
* J = K = 0 → No change * J = 0, K = 1 → Q = 0 (like RESET) * J = 1, K = 0 → Q = 1 (like SET) * J = K = 1 → Toggle
147
How do the asynchronous inputs (PR and CLR) on a JK bistable alter its operation?
The JK bistable will remain in the state determined by the J and K inputs, changing only on a rising clock edge, until altered by the asynchronous inputs. The JK bistable will then immediately take the state set by the asynchronous inputs until the next clock pulse where it will return to the state set by the J and K inputs. (In the case of J = K = 1 [toggle], the bistable will invert its current state - which means it will become the opposite of the state forced by the asynchronous input).
148
What is the characteristic/excitation table of a JK bistable?
The characteristic/excitation table defines what inputs are required to achieve a particular output change:
149
What are the applications of bistables?
They can be classified into 2 groups: * Counter circuits: Divide by n counters, ripple counters, synchronous counter, Johnson counter * Memory circuits: shfit register, parallel loading shift register
150
What is the structure of a divide by 2 counter?
It consists of a single JK bistable with J = K = 1
151
How does a divide by 2 counter work?
It is a single JK bistable with J = K = 1, therefore toggles every rising clock edge. This leads to an output where the frequency is half of the input clock. There is a propoagation delay.
152
What is a propagation delay for a bistable?
The small amount of time taken for the bistable to change its state based on the inputs when the clock goes high.
153
What is the structure of a ripple counter?
It is a chain of JK bistables where the output *bar* of each stage acts as the clock for the following stage.
154
How does a ripple counter work?
As each output*bar* acts as a clock for the following stage, it divides the frequency exponentially. In the below example there are 4 bistables, so it is a divide by 2⁴ = 16 counter. As it is the output ***bar***, each stage acts on the falling edge of the previous stage (rather than the usual rising edge). However, due to propagation delays accumulating, glitches/transitory states can occur.
155
What is the issue with ripple counters?
Transitory states: * Transitory states are glitches due to finite delays between clock signals changing and the JK output changing * This can arise if we use the output of a bistable as the clock to another bistable
156
What is a synchronous counter?
It is similar to a ripple counter, however all bistables share a common clock so there is no propagation delay accumulation and all outputs change simultaneously.
157
Why is each stage in a ripple counter triggered by a falling edge of the previous output?
As the inverted output (Q bar) is used as a clock for the following stage. Therefore the rising edge of Q bar drives the following stage - but the rising edge of Q bar, is the falling edge of Q.
158
How does a synchronous counter work?
* All bistables share a common clock so there is no propagation delay accumulation and all outputs change simultaneously. * The output of a JK bistable is high when the clock is high and the output of the previous 2 bistables is 1
159
What is a shift register and what does it do?
* A shift register is a series of D-latches with the output of one bistable being the input to the next. They are all connected to a common clock. * A shift register takes in data, stores it, and shifts it through a chain of bistables. **The data is shifted one position per clock pulse.**
160
What is a parallel loading and how does it work?
Parallel loading allows the initialisation of a shift register with parallel data. It allows a shift register to take in multiple data bits simultaneously - with one input needed per bit - and store them in its bistables in a single clock cycle. For each following clock cycle the bits are shifted along the bistables.
161
What is a serial data link?
A parallel loading shift register is used to send one data bit at a time across the serial link to another shift register. It’s the opposite of a parallel data link. You can clock the data through and then (when all the data is in position) read it in one go. As it is a single wire, far fewer wires are required than for a fully parallel link, however it is much slower as data is sent one bit at a time.
162
What is a Johnson counter?
A Johnson counter uses a shift register of length N to produce a sequence of length 2N. The output of the last bistable is inverted and fed to the first. As seen in the diagram below, each bit is shifted one along, whilst the bit of the final bistable is shifted AND inverted.
163
What is a twisted ring counter?
A Johnson counter
164
How can a divide by 5 counter be made using an asynchronous clear?
This design is vulnerable to glitches, if 101 is detected an asynchronous clear must be performed to reset the bistable and restart. The counter resets to 000 - giving a 5-state cycle: 000 → 001 → 010 → 011 → 100 → (reset) ## Footnote FLASHCARD INCOMPLETE, RESEARCH THIS
165
What are the 5 stages of synchronous logic design?
1. State diagram 2. Bistable allocation 3. State transition table 4. Karnaugh maps 5. Circuit diagram
166
For synchronous logic design, what is the equation for the number of JK bistables required?
Number of JK bistables = log₂(number of states) ## Footnote you must round up!
167
What is a state diagram? ## Footnote For synchronous logic design
It is the first stage in synchronous logic design, it defines all the distinct states of the system and how they transition based on inputs: * It has a box for each of the required states * For each of the boxes (states) arrows representing each of the possible combinations of the inputs point to the resulting state if these were the inputs when the circuit was in this state (this can be the next state, a previous state, or even itself) There must be a path leaving each state for every possible combination of inputs (i.e. for a case of a 2 input system, there must be 4 paths leaving every state)
168
What is bistable allocation? ## Footnote For synchronous logic design
It is the second stage in synchronous logic design: Assign binary codes to represent each state you can choose from which bistable outputs (or combination of) that each digit will be taken from. For N states, you require log₂(N) JK bistables (rounded up to the nearest integer) ## Footnote A key aspect of this is that you decide the binary codes chosen to represent each state!!!
169
What is a state transition table? ## Footnote For synchronous logic design
It is the third stage in synchronous logic design: Create a table showing the current state, the inputs, the corresponding next state for the input and current state, and then the required bistable input values to make the transition. You can determine this using the excitation table in the data book. Using the excitation table in the databook, you can compare Qₙ and Qₙ₊₁ and hence determine the required J and K values. For the below example this should be done for both bistables A and B ## Footnote Note: You should handle unused states (i.e. if you somehow end up in an intended unused state you should be returned to the initial state)
170
What is the role of karnaugh maps for synchronous logic design?
Karnaugh maps are the fourth stage of synchronous logic design: Use Karnaugh maps to determine the simplest Boolean logic expressions for each bistable input (i.e. each J and each K for every bistable)
171
What is the circuit diagram stage for synchronous logic design?
This is the fifth and final stage of synchronous logic design: Based on the Boolean logic expression obtained from the karnaugh maps construct a full logic circuit. Note: all bistables should be clocked synchronously (together)
172
Design the appropriate logic circuit
173
What is a weighted resistor DAC (Digital-to-analogue converter)?
A weighted resistor DAC (Digital-to-Analog Converter) is a circuit that converts a binary number (digital input) into a corresponding analog voltage using resistors with values weighted according to binary significance.
174
What are the drawbacks of a weighted resistor DAC?
* Lots of resistance values whicha re difficult to implement * If the LSB is 5% accurate then the MSB must be 5%/2ⁿ⁻¹. If n=8 this comes to 0.04% which is time consuming and expensive to achieve * A wide range of resistor calues are required. These will need to be made from different materials so the way they change with temperature will be different. The output of the circuit will probably drift as it warms up
175
What is an R-2R Ladder DAC?
A type of digital-to-analog converter that uses only two resistor values -R and 2R - arranged in a repeating ladder-like network to convert a binary digital signal into an analogue voltage
176
How does an R-2R Ladder DAC work?
Each stage halves the current so binary weighting is maintained
177
How does an R-2R Ladder DAC compare with a weighted resistor DAC?
R-2R resistors are: * Much more accurate * Potentially cheaper * More stable and scaleable
178
What is a 1 bit ADC (comparator)?
Vₒᵤₜ = Gain x (Vᵣₑ𝒻 - Vᵢₙ), but when the gain is very large: Vᵢₙ > Vᵣₑ𝒻 → Vₒᵤₜ = V- Vᵢₙ < Vᵣₑ𝒻 → Vₒᵤₜ = V+ The output switches depending on whether Vin or Vref are greater
179
What is a Schmidt Trigger?
It is like a 1 bit ADC comparator but it adds positive feedback to create a hysteresis effect
180
How does a Schmidt trigger work?
Unlike the 1 bit ADC comparator, it has two thresholds: upper and lower, to avoid false triggering due to noise. * If Vin is low intitially, then Vin must rise above Vupper for Vout = 0 * Then Vin must drop below Vlower for Vout = 1
181
What is a flash ADC?
A flash ADC uses a resistor ladder and many comparators. Each comparator compares Vin to a different reference level and it outputs a parallel binary output
182
What are the drawbacks of a flash ADC?
Lots of comparators required: * 8-bit resolution needs 256 comparators, 12-bit requires 4096!
183
What is a Stair-Step Ramp ADC?
* Alternative to flash ADC: much slower, but uses only one comparator. * A DAC generates a ramp (or staircase) signal. * When DAC output drops below Vin the counter value is the digital output
184
What is a full adder?
It takes 2 bits Aᵢ, Bᵢ, and carry in Cᵢ, outputs sum Sᵢ and carry out Cᵢ₊₁ * Carry bit: Needs 2 or more bits to be HIGH * Sum: Needs and odd number of inputs to be HIGH
185
What is the full adder circuit?
186
Whats a ripple carry adder circuit?
* Combines multiple full adders to add multi-bit numbers. * Carry-out from one adder feeds into carry-in of the next
187
How can a ripple carry adder circuit perform subtraction?
If A is inverted and carry in C₀ = 1, then the adder performs subtraction: S = B - A
188
What is a microprocessor?
* A microprocessor is a computer on a chip, it is used to control digital devices. * They run programs made of simple, low-level instructions
189
What is Von Neumann architechture?
the foundational design for most modern general-purpose computers
190
What are the basic microprocessor system elements?
The **microprocessor** itself comprising:: * An **Arithmetic Logic Unit (ALU)** which performs mathematical and logical operations * A **control unit** that manages the execution of the code / instructions * Multiple **registers** that are used as **temporary** storage for instructions and data **Input** and **Output** ports to interface to the outside world **Buses** to connect everything: * **Address bus** to address the memory locations and i/p and o/p ports * **Data bus** to carry data to/from locations (bidirectional) * **Control bus** to send control signals
191
What does an **Arithmetic Logic Unit (ALU)** do?
* Performs operations like addition, subtraction, AND, OR, etc * Can perform simple comparison operations * To make an n-bit ALU, cyou must connect n one-bit ALU's together using a bus
192
What is the basic structure of a bus?
* The data bus is bidirectional * The address and control busses are unidirectional ## Footnote Modern processors may use 32-64 bit buses byt the basic architechture remains
193
What is a read operation process for a microprocessor?
* Address (of the memory location) is set on the address bus * Set the read wire of the control bus to **high** * Set the address valid control wire high These will come together the activate the memory chip select (active low) Contents of the memory location are placed on the data bus and retrieved Once the data is read (usually into a register on the microprocessor), the control wires can be "reset"
194
How is the read/write wire labelled?
195
What is the write operation process for a microprocessor?
* Address (of the memory location) is set on the address bus * Set the read wire of the control bus to **low** (this requests a write operation) * Set the address valid control wire high Contents of the data bus is then placed at the memory location Once the data is written to the memory, the control wires can be "reset"
196
What is the memory address capacity?
**Total addressable memory locations = 2ᵃ x b** a = number of address wires b = number of data wires
197
What are registers?
Temporary storage for instructions and data within the microprocessor
198
What is a program counter?
A program counter (PC) is a (13 bit for PIC) register inside the microprocessor that stores the program memory address of the next instruction to be executed
199
What is the Fetch-Decode-Execute cycle?
The standard instruction cycle for a microprocessor: * The processor first fetches the instruction from the address strored in the PC * The fetched instruction is then decoded so that it can be interpreted by the microprocessor * Once, decoded, the instruction is executed and the PC incremented so that it contains the address of the next instruction
200
Do you need to remember PIC assembly instructions?
**NO**, they are all in the databook!!!
201
What are memory chips?
202
What is the RAM chip architecture?
203
How does an address decoder work within a RAM chip?
204
How does each individual memory element within a RAM chip work?
205
What does the working register hold?
206
What are tri-state buffers?
A digital component that acts like a switch, allowing a signal to pass through when enabled or effectively disconnecting the output when disabled by acting as a very-high impedance
207
How do you address the location of a certain bit for multiple memory chips?
Using MSB address lines to select chips; lower bits select location within chip.
208
How are input and output ports treated by the microprocessor?
They are treated as memory locations
209
What are the different types of memory?
210
What is an assembler?
An assembler translates an assembly language program into op-codes that are understood by the microprocessor
211
How are numbers represented in assembly?
212
What do typical assembly program operations consist of?
213
What are the 2 types of assembly operations?
214
How can you perform addition or subtraction in assembly code?
215
How do logical operations work in assembly?
They work bitwise. This means each bit of the operands is independently affected by the operation
216
What is the GPIO register?
General Purpose Input/Output register: For the PIC12F675 the GPIO register acts as a 6 bit wide bidirectional port * All bits but one can act either as an input and an output * The exception is bit 3 which can only be an input
217
What is the TRISIO register?
The corresponding data direction for the GPIO is managed by the TRISIO register: * Setting a bit (=1) in the TRISIO register makes the corresponding bit in the GPIO an input * Clearing a bit (=0) in the TRISIO register makes the corresponding bit in the GPIO an output (Note: TRISIO bit 3 is always set)
218
What would the assembly code for the below operations look like?
219
What is the STATUS register?
Several individual bits (flags) in the STATUS register hold information about the result of the last arithmetic/logical operations. These can be used to determine the result of a conditional instruction. Its register locations is 0x03
220
What is the carry flag?
The carry (C) flag is set when there is a carry from the most significant bit during a calculation. It is bit 0 of the STATUS register.
221
What is the zero flag?
The zero (Z) flag is set when the result of an instruction is zero. It is bit 2 of the STATUS register.
222
What is the Digit Carry (DC) Flag?
A byte made up of 2 "nibbles" - each of 4 bits. The DC flag is set whenever this is a carry from the lower to the upper nibble (i.e. bit 3 to bit 4). It is bit 1 of the STATUS register
223
What are flowcharts for assembly programs?
Flowcharts are a graphical technique for designing short programs: * They encourage design of the overall algorithm * Independent of microprocessor architecture or instruction set * Easier to read than machine code / assembly language
224
What is "goto"?
goto makes the program jump to a label. This can be used to repeat loops until a condition is met
225
What is the programme run time for a PIC processor?
For most PIC processors each intruction takes one internal clock cycle to execute. However there are 2 main exceptions: * Instructions (such as goto, call, return etc) which need to replace the PC contents take two cycles * Test/conditional branch instructions: If the conditional branch does not skip the next instruction, only one cycle. If the conditional branch does skip, it discards the next instruction and executes a nop. Therefore there are 2 cycles.
226
What is the File Select Register (FSR)?
It is used for indirect addressing If a file register address is loaded into FSR, the contents of that register can be read through the Indirect File Register (INDF) This method can be used to access a set of data in memory locations by reading/writing the data via INDF and selecting the next location by incrementing FSR Particularly useful for storing a sequence of data that has been read in through a port
227
What is the Stack?
228
How is the stack used in a PIC12F629?
It is automatically used for sub-routines. There is no need to worry about it in the course of day-to-day PIC programming
229
What are subroutines?
Subroutines are used to carry out discrete programma functions (or mini-programmes). They allow programmes to be written in manageable self contained blocks which can be executed as required. **call** is used to jump to a sub-routine and **return** to terminate it and return to the main program. **retlw** is similar to return but also stores literal value in W The call instruction has teh address of the sub-routine as an argument
230
What are interrupts?
231
What is the Reset pin?
232
In what circumstances is the RESET pin usually used?