Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. Learning Objectives: At the end of this topic you will be able to; understand the procedure needed to write and read content to memory addresses; design and analyse systems that use a memory IC as a programmable logic device. 1 GCSE Electronics. Unit E2 : Applications of Electronics Sequence Controllers In Topic 2.2.2 we considered how binary counters and logic circuits could be combined to produce fully automated systems. They were in fact the simplest form of sequence controllers. We designed simple systems that were used to control sequences, such as disco lights and traffic lights. There are two disadvantages with this simple approach. i. The sequence is fixed once the combinational logic circuit has been constructed and is difficult to change, or modify to do a different task. ii. Each step of the sequence is determined by the time of the clock. In the simple traffic light sequence we constructed the four steps of the sequence i.e. Red, Red and Amber, Green, and Amber all came on for exactly the same length of time. This is clearly not a realistic situation. We need a more flexible approach to the design of these automated sequences. Later on we will look at programmable systems, but we will start by considering the use of another electronic component, the memory circuit. Memory Circuits Within an electronic system, memory is simply a set of locations where binary information is stored. It has two essential properties: 2 i) The location where every item of information is stored must have a unique address. ii) It has to be possible to read items of information from each location in the memory, separately. Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. Binary information is stored as 0’s and 1’s. Subsystems are needed which can be set to 0 or 1 and remember that setting. In topic 2.2.1 we considered how a D-type flip-flop was used for data transfer The D-type flip-flop passes the D input state to the Q output only when it receives a clock pulse. The data on the input can be changed between clock pulses without affecting the Q output. As a result, the D-type flip-flop can form the basic building block of memory circuits. It is often referred to as a ‘1-bit’, or ‘1 address’ memory element. Several can be connected together to store an item of information. We now shall now consider 1-bit and 2-bit memory elements. Note : Activities 1 and 2 are not examinable but illustrate the process of information storage. 3 GCSE Electronics. Unit E2 : Applications of Electronics Activity 1: Using a D-Type flip-flop to make a memory element. INFORMATION: A 1-bit memory element is basically the D-type flip-flop we used previously for data transfer with the clock input being relabelled as ‘Write’. 1a. Set up the following 1 bit memory circuit in ‘Livewire’ or ‘Circuit Wizard’ as shown below. 1b. SW1 represents a ‘Data’ input, SW2 represents ‘Write’ and SW3 represents ‘Reset’. What is the logic level at the D input when SW1 is open ? .................. What is the logic level at the D input when SW1 is closed ? .................. 1c. 4 Start the simulation. If the LED is on, then press and release the reset switch. Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 1d. Close SW1, setting the data to logic 1, then press and release SW2 to ‘Write’ the data into ‘memory’. Is the LED on ? ............................. 1e. Open SW1, setting the data to logic 0. Does this change the output state ? ..................... Explain how you could reset the output to a 0. .................................................................................................................................... 1f. Use another D-type flip flop to form a 2-bit memory element with a common ‘Write’ switch and common ‘Reset’ switch. The circuit diagram is shown below. 1g. Set up and test your circuit. Comment on the performance. .................................................................................................................................... .................................................................................................................................... 5 GCSE Electronics. Unit E2 : Applications of Electronics Activity 2: Adding a ‘Read’ facility In activity 1 the content of the memory bit was displayed all the time. The content should only be displayed when a READ operation is carried out. The next step is to include a READ line into the circuit. 2a. Modify your circuit to include a “Read “input and two AND gates as follows. 2b. Check your circuit carefully and then start the simulation. 2c. You should now be able to write data into the memory bit and then read the content. To WRITE information into memory and then READ the content the procedure is as follows: i) ii) iii) iv) 6 Set data using SW1, and SW2, Pulse the write line SW3, Press the read line SW5, You see the data you set appear on the LEDs. Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 2d. Write a 11 into the bit store and then read the content. Write a 10 into the bit store, read the content then reset Check the content is now 00. Write a 01 into the bit store, read the content then reset. Comment on the performance of the 2-bit memory. .................................................................................................................................... .................................................................................................................................... 2e. This basic 2-bit memory can now be extended by simply adding more Dtypes, as shown below to form a 4-bit memory element. (You do not have to set this up unless you want to.) Information: Dedicated memory ICs do not usually have a separate read and write line, as we have used in this example. Dedicated memory ICs have a single input usually labelled Re ad / Write instead of two separate inputs. When the logic level on this pin is high, data is read from the memory location, when the logic level is low, the data present on the data pins is written into the memory location. 7 GCSE Electronics. Unit E2 : Applications of Electronics A Simple Memory Array Memory arrays can vary greatly in size. They range from as small as 64-bit for a small control system to more than 4GB of memory in a computer - a massive 32,000,000,000 bits, roughly. In activity 2, you constructed a 2-bit memory element and we introduced a 4bit memory element. The circuitry involved in these memory elements is becoming quite extensive even though it is quite repetitive in its design. We will change the way we look at this 4-bit memory element to the diagram below. 4-bit Memory Element Read / Write Data In / Out Even though we can store 4 bits of information in this memory element, it represents only one item of information, and so is a bit limited as a memory. The solution is to build many of these circuits and stack them on top of each other to create an array of storage locations. Read / Write 4-bit Memory Element 3 We have now created a 16 bit memory made up of 4 x 4 bit memory locations. 4-bit Memory Element 2 4-bit Memory Element 1 4-bit Memory Element 0 Data Bus 8 The Data In / Out lines have now been called a Data Bus. A bus is a collection of wires that are connected to each memory element. Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. We now need a means of selecting one particular memory. This can be achieved by using logic gates to select the required memory element. In this simple example we have 4 different memory elements, and so four unique codes or addresses are required to identify them. For example, ‘00’ could access memory element 0, ‘01’ could access memory element 1, ‘10’ could access memory element 2, and ‘11’ could access memory element 3. In this simple example just 2 address lines can provide the four unique combinations needed to identify each memory element. The full circuit therefore becomes: 4-bit Memory Element 3 4-bit Memory Element 2 4-bit Memory Element 1 4-bit Memory Element 0 Data Bus Read / Write A1 A0 Address Bus For this course we will limit the memory size to a maximum of 4 address lines (and so 16 elements,) and up to 8 data lines, (equal to 16 x 8 = 128 bits.) A group of bits which occupies one storage address is often referred to as a binary word. This usually represents one item of information. 9 GCSE Electronics. Unit E2 : Applications of Electronics A bigger memory has more memory elements, and so needs more address pins to be able to select each element. To access the 16 locations in our array we need 4 address lines, since 24 = 16. Once again we will simplify the diagram of the memory array and represent our 64-bit memory as: Each memory location has a unique address. The binary addresses for 16 elements will from 0000 to 1111 and can be set up on four address lines A0, A1, A2 and A3. (The data here is just an example) Data in Location Location Address A3, A2, A1, A0 0000 0001 0010 0011 0100 MSB D 1 0 1 1 0 C 0 0 1 0 1 B 0 1 0 0 1 LSB A 1 0 0 0 0 1110 1111 0 1 0 1 1 0 1 1 Since each location is made up of four bits ( i.e. a 4-bit word) we will also need four data lines for reading from or writing to a particular location. 10 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. The logic level on the read/write pin will tell the memory whether we wish to see (read), or store data (write), to the memory location. When the read/write pin is at logic level 1 the data stored in the location appears on the output data lines. To write to a location its address is set up on the address lines and the data to be stored is set up on the data lines. The read/write line is then momentarily taken to logic level 0. The new data is then stored in the location, overwriting any previous data. Example – setting up the data shown in the previous table i. ii. iii. iv. v. Set the address lines to 0000. Set the data lines to 1001. Momentarily connect the read/write line to zero volts, and the new data will be stored in that location. Set the read/write line to logic 1. The data lines will show 1001 stored in that location. Do the same for the other elements of the memory. We will now look at some worked examples to show you how a memory element can be used to solve some sequencing problems. 11 GCSE Electronics. Unit E2 : Applications of Electronics 1. A memory IC is used to control a lighting sequence on four LED’s The four LED’s run through the following sequence repeatedly. (a) How many of the data pins on the memory IC are used to control the LED sequence? Answer: There are three separate LED output indicators, therefore 3 data lines, one for each LED are required. (b) How many address locations are used to store the LED sequence? Answer: There are six separate LED output patterns in the sequence, therefore 6 address locations will be required, one for each pattern are required. (c) How many address pins must there be on the memory IC? Circle your answer from the following list: 2 3 4 5 2 address lines would give 22 = 4 memory locations, 3 address lines gives 23 = 8 memory locations, which is more than the 6 we need. 12 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 2. The block diagram shows how a disco light sequence can be generated using a memory IC. The memory stores the following data: A2 0 0 0 0 1 1 1 (a) A1 0 0 1 1 0 0 1 A0 0 1 0 1 0 1 0 D3 0 1 1 0 1 0 D2 D1 1 0 0 1 1 1 1 1 1 1 0 0 Reset D0 1 0 0 1 1 0 How many lamps can be controlled separately by this system? Answer: There are 4 data lines on the memory IC therefore the maximum number of lamps that can be controlled separately is 4, one per output. (b) How many separate steps (patterns) are stored in this sequence? Choose your answer from the following options: A. 3 B. 4 C. 5 D. 6 E. 8 F. 16 Answer: D. 6, There are six different patterns 13 GCSE Electronics. Unit E2 : Applications of Electronics (c) This memory IC has 3 address pins A2, A1, and A0. What is the maximum number of steps that can be stored in this IC? A. 3 B. 4 C. 5 D. 6 E. 8 F. 16 Answer: E. 8, Three address lines gives 23 = 8 possible memory locations. (d) 14 A disco light sequence can be generated using a logic system instead of the memory IC. What is the advantage of using the memory IC? A logic system has its function hard-wired into it and cannot be changed without re-designing the system. A memory IC can be reprogrammed with a new sequence very easily and does not require a hardware change. A memory IC is therefore much more flexible. Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 3. The diagram shows the contents of part of a memory IC. It is used to control a set of LEDs The memory stores the following data: A2 0 0 0 0 1 1 (a) A1 0 0 1 1 0 0 A0 0 1 0 1 0 1 D3 0 1 1 1 0 D2 D1 0 1 1 1 1 0 0 0 0 1 Reset D0 1 1 0 1 1 Key: A = Address D = Data How many LEDs can be controlled separately by this section of the memory IC? Answer: 4 (There are four data lines, each of which can control an LED.) (b) How many memory locations are used to store this part of the LED sequence (including ‘Reset’) ? Answer: 6 (Five locations containing data patterns, and one for the reset.) (c) How many separate address locations can be identified using three address bits? Answer: Three address lines gives 23 = 8 possible memory locations. 15 GCSE Electronics. Unit E2 : Applications of Electronics (d) The block diagram for the control system is shown below. The system needs a circuit added to make it reset properly. The counter must reset when memory location 1 0 1 is addressed. The counter resets when the reset pin receives a logic 1 signal. Complete the following circuit diagram to show: What type of logic gate is used (using the correct symbol); How the inputs of the logic gate are connected to the counter outputs; How the output of the logic gate is connected to the counter. 16 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 4. (a) A memory IC has six data lines and four address lines. (i) How many memory locations are there on this IC? 24 = 16 (ii) How many bits of data can be stored in the IC? 16 x 6 = 96 bits (b) The memory IC controls two sets of traffic lights at a road junction in a model village. The block diagram of the system is shown below. The required sequence is Set 1 Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 GREEN light on GREEN light on ORANGE light on RED light on RED and ORANGE light on GREEN light on Set 2 RED light on RED light on RED and ORANGE lights on GREEN light on ORANGE light on RED light on 17 GCSE Electronics. Unit E2 : Applications of Electronics Complete the table with the series of binary codes to store the sequence. A logic 1 in the location switches the LED on. Memory Address 0000 0001 0010 0011 0100 0101 0110 (c) Memory locations D0 D1 D2 D3 D4 D5 0 0 0 1 1 0 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1 0 0 1 0 0 1 0 1 0 0 0 0 1 0 0 Reset The clock and 4-bit counter select each memory location in turn. The counter resets at the end of the sequence and the sequence then repeats itself. (i) What is the binary address of the first unused memory location? (ii) 0110 Complete the diagram below to show how the counter is reset. Bit A of the counter is connected to the least significant bit of the memory address. (iii) The counter resets when the reset pin in high. What logic gate is needed to make the counter reset correctly ? NAND Gate (Reset is active low) 18 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 5. The next block diagram shows a system which repeatedly generates a sequence of disco lights. It uses a memory IC to store the sequence. The pulse generator and counter select each memory location in turn. The memory stores the following data: A3 0 0 0 0 0 0 0 0 1 1 Address A2 A1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 A0 0 1 0 1 0 1 0 1 0 1 D3 0 1 1 1 1 1 1 1 0 Data D2 D1 0 0 0 0 1 0 1 1 1 1 1 1 1 0 0 0 0 0 Reset D0 0 0 0 0 1 0 0 0 0 19 GCSE Electronics. Unit E2 : Applications of Electronics (a) Complete the following table by adding either Off or On to show the sequence of lights produced by the system. Red Off On On On On On On On Off (b) Blue Off Off On On On On On Off Off Green Off Off Off On On On Off Off Off Yellow Off Off Off Off On Off Off Off Off The circuit for the pulse generator uses a 555 timer. The frequency of the pulses controlled by a resistor R and a capacitor C with the following values: Resistor R = 100kΩ, Capacitor C = 10µF The approximate value of the frequency f, in Hz, of the pulse generator is given by the formula: f 0 .7 RC Where R is in MΩ and C is in µF. Use this formula to calculate the frequency of the pulse generator. f (c) 0.7 0.7 0.7Hz RC 0.110 For how many seconds is the yellow LED lit, in the sequence? Answer : The Yellow LED is only on for one part of the sequence. This means just one cycle of the pulse generator, therefore T = 1/f = 1/0.7 = 1.414 s 20 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. (d) The counter resets when the reset pin receives a logic 1 signal. Output A is the least significant bit of the counter output. Complete the following circuit diagram by adding a logic gate and the connections necessary to make the counter reset when the counter output reaches 0101. (e) The red, blue, green and yellow lamps are rated at 6V, 0.5A. (i) Choose a suitable device to interface one of these lamps to the memory chip. Answer: A current of 0.5A is quite small and well within the range of a transistor, so a transistor would be suitable in this case. If the current requirement was greater than 2A then a MOSFET would need to be used. (ii) Complete the circuit diagram to show how this interface connects the yellow lamp to the D0 output of the memory chip. Now its time for you to have a go! 21 GCSE Electronics. Unit E2 : Applications of Electronics Student Exercise 1: 1. What are the basic requirements of a memory circuit ? ........................................................................................................................................ ........................................................................................................................................ 2. ........................................................................................................................................ [1] a) If a memory chip has 4 address lines, how many different data patterns (binary words) can be stored in the memory? b) ............................................................................................................................. [1] If a memory chip has 8 address lines how many different data patterns (binary words) can be stored in the memory? c) ............................................................................................................................. [1] If a memory chip has 16 address lines how many different data patterns (binary words) can be stored in the memory? d) ............................................................................................................................. [1] If a memory chip has ‘n’ address lines, how many different data patterns (binary words) can be stored in the memory? ............................................................................................................................. [1] 22 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 3. a) Draw a block diagram of a memory chip having 4 address lines, 4 data lines and a read/write line. [1] b) Describe how you would write 1001 into the memory at address 1101. ........................................................................................................................................ ........................................................................................................................................ ........................................................................................................................................ ........................................................................................................................................ c) [2] Describe how you would read the data to ensure that it had been successfully recorded in the memory. ........................................................................................................................................ ........................................................................................................................................ ........................................................................................................................................ ........................................................................................................................................ [2] 23 GCSE Electronics. Unit E2 : Applications of Electronics 4. Under what circumstances would it be worth considering using a memory chip to perform a logic function? ........................................................................................................................................ ........................................................................................................................................ [1] 5. A memory chip is available with 3 address lines A0, A1, and A2, 8 data lines and a read/write line as shown below. A disco light sequence is to be programmed and repeated continuously on a display containing 8 lamps. The following sequence is required. 24 L1 L2 L3 L4 L5 L6 L7 L8 On Off Off Off On Off Off Off On Off On Off On On Off On On Off Off Off Off On Off On On Off On On Off On On On Off Off On Off Off Off On Off On Off Off Off On On Off On Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. a) A2 L1 is connected to D1, of the memory chip, L2 to D2, L3 to D3 etc. Complete the table to show the data programmed into the memory to produce the sequence of lights. Address A1 A0 D1 D2 Desired Output D3 D4 D5 D6 D7 D8 [6] 25 GCSE Electronics. Unit E2 : Applications of Electronics Solutions to Student Exercises 1. The basic requirements of a memory system are: It should be programmable (at least once). The data should be easily read. The data must be retained, (at least while the power is on.) 2. 3. 26 a) 24 = 16 b) 28 = 256 c) 216 = 65536 d) 2n a) b) Set the address line to 1011, set the data lines to 1001, then press write. c) Set the address line to 1011, set the read line on. Observe data on output pins. Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 4. 5. Memory chips are used to provide logic functions when the logic required is particularly complex, making it very expensive to model in standard logic packages. Address A2 A1 A0 D1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 0 D2 0 0 1 0 1 0 Desired Output D3 D4 D5 D6 D7 D8 1 0 1 1 0 0 1 0 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 Now for some examination style questions. 27 GCSE Electronics. Unit E2 : Applications of Electronics Examination Style Questions 1. (a) A memory IC has six data lines and four address lines. (i) How many memory locations are there on this IC? ........................... (ii) How many bits of data can be stored in the IC? ........................... [2] (b) The memory IC controls two sets of traffic lights at a road junction in a model village. The block diagram of the system is shown below. The required sequence is Set 1 28 Set 2 Step 1 RED light on GREEN light on Step 2 RED light on Green light on Step 3 RED and ORANGE lights on ORANGE light on Step 4 GREEN light on RED light on Step 5 ORANGE light on RED and ORANGE light on Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. Complete the table with the series of binary codes to store the sequence. Memory Address Memory locations D0 D1 D2 D3 D4 D5 0000 0001 0010 0011 0100 0101 0110 (c) The clock and 4-bit counter select each memory location in turn. The counter resets at the end of the sequence and the sequence then repeats itself. (i) What is the binary address of the first unused memory location? .................... [1] (ii) Complete the diagram below to show how the counter is reset. Bit A of the counter is connected to the least significant bit of the memory address. [3] (iii) The counter resets when the reset pin in high. What logic gate is needed to make the counter reset correctly ? .................................................... [1] 29 GCSE Electronics. Unit E2 : Applications of Electronics 2. A car factory sprays a batch of cars “lime green”. The colour is made by mixing yellow (valve Y) and green (valve G) paint in the correct proportions by opening the valves. A logic 1 signal opens the valve. These two paints are mixed with a blade attached to a motor (M). The cars are then painted with the sprayer (P). The steps of the process are stored in a memory IC and each memory location is accessed in turn under the control of a clock and a 4-bit counter. Memory Address 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 Memory locations Valve Y Valve G Motor M Sprayer P 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 (a) The clock gives 1 pulse every ½ minute. How long is the sprayer P on? (b) .................................................................................................................................................. [1] Twice as much of one of the colours is needed. Which valve is supplying this? .................................................................................................................................................. [1] 30 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. (c) The 4-bit counter can be reset after the correct number of sequence steps to allow the process to be repeated. (i) Write down the binary memory address of the first unused memory location. .................................................................................................................................................. [1] (ii) Complete the diagram below to show how the counter can be reset. Output A is the least significant bit. [3] (d) (i) This memory IC has 4 address lines. How many memory locations does it contain? .................................................................................................................................................. [1] (ii) What is the maximum time for which this memory IC could open a valve? (The clock is ½ minute per pulse) (e) .................................................................................................................................................. [1] Describe one advantage of using a memory IC rather than logic gates to control this type of industrial process. .................................................................................................................................................. .................................................................................................................................................. .................................................................................................................................................. [2] 31 GCSE Electronics. Unit E2 : Applications of Electronics 3. In a factory, two chemicals are mixed by opening two valves P and Q. The mixture is stirred using a motor R. An outlet valve S is then opened to remove the finished product. The process then repeats. The timing sequence for the process is shown in the following table. Device operated Inlet Valve P Inlet Valves P and Q Motor R Outlet valve S All devices off REPEAT Time (seconds) 20 20 ? 60 20 The sequence used to control this process is stored in a memory IC which stores a 4-bit binary number in each memory location. Each memory location is accessed in turn under the control of a clock and a 4-bit counter. The clock gives out one pulse every 20 seconds. (a) Complete the table opposite with the series of binary codes to store the sequence. Note: Logic 1 in a memory location will operate the device connected to the location. Memory Address Memory contents Valve S Motor R 0000 0 0001 0 Valve Q Valve P 0010 0 1 0 0 0011 0 1 0 0 0100 0 0101 0 0110 0 0111 REPEAT 0 [5] 32 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. (b) For how many seconds does the Motor R run? (c) Which valve, P or Q, is open for the longer time? .............................................. [1] .............................................. [1] (d) The memory IC has four address lines. What is the maximum number of sequence steps that can be stored in the IC? .................................................................................................................................................. [1] (e) The 4-bit counter resets after the sequence finishes, to make the process to repeat itself. The counter is reset by taking the reset pin to logic 1. Complete the diagram below to show how this can be done. Bit A of the counter is connected to the least significant bit of the memory address. [2] 33 GCSE Electronics. Unit E2 : Applications of Electronics 4. The next block diagram shows a system which repeatedly generates a sequence of disco lights. It uses a memory IC to store the sequence. The pulse generator and counter select each memory location in turn. The memory stores the following data: A3 0 0 0 0 0 0 (a) Address A2 A1 0 0 0 0 0 1 0 1 1 0 1 0 Data A0 0 1 0 1 0 1 D3 0 1 1 1 1 D2 0 0 1 1 1 D1 0 0 0 1 1 D0 0 0 0 0 1 Reset Complete the following table by adding either Off or On to show the sequence of lights produced by the system. Red Blue Green Yellow Off [2] 34 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. (b) The circuit for the pulse generator uses a 555 timer. The frequency of the pulses controlled by a resistor R and a capacitor C with the following values: Resistor R = 100kΩ, Capacitor C = 10µF The approximate value of the frequency f, in Hz, of the pulse generator is given by the formula: f 0 .7 RC Where R is in MΩ and C is in µF. Use this formula to calculate the frequency of the pulse generator. .................................................................................................................................................. .................................................................................................................................................. .................................................................................................................................................. [3] (c) For how many seconds is the yellow LED lit, in the sequence? .............................. [1] (d) The counter resets when the reset pin receives a logic 1 signal. Output A is the least significant bit of the counter output. Complete the following circuit diagram by adding a logic gate and the connections necessary to make the counter reset when the counter output reaches 0101. [3] 35 GCSE Electronics. Unit E2 : Applications of Electronics (e) The red, blue, green and yellow lamps are rated at 9V, 3A. (i) Choose a suitable device to interface one of these lamps to the memory chip. ............................................................ [1] (ii) Complete the circuit diagram to show how this interface connects the yellow lamp to the D0 output of the memory chip. [2] 36 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. 5. A memory IC is used to control a lighting sequence on four LED’s The four LED’s run through the following sequence repeatedly. (a) How many of the data pins on the memory IC are used to control the LED sequence? Answer ................................................. [1] (b) How many address locations are used to store the LED sequence? Answer ................................................. [1] (c) How many address pins must there be on the memory IC? Circle your answer from the following list: 2 3 4 5 [1] 37 GCSE Electronics. Unit E2 : Applications of Electronics 6. A memory IC is used as part of a control system in a bakery. The input sensors are connected to the address lines and output devices are connected to the data outputs as shown below. (a) Different sensor conditions allow different memory locations to be accessed. (i) How many memory locations does the memory IC contain? (ii) Why is the A2 address line connected to zero volts (logic 0)? ...................... [1] ............................................................................................................................................................. ............................................................................................................................................................. [1] (b) (i) The behaviour of the control system is given in the following table. Sensor Condition Both sensor outputs low Only the green LED on Sensor A output high Sensor B output low Sensor A output low Sensor B output high Green LED on, solenoid on, oven on, and buzzer off. Green LED on, solenoid on, oven off, and buzzer on. Green LED off, solenoid off, oven on and buzzer on. Both sensor outputs high 38 Outputs Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. (ii) Complete the Memory Contents section of the table below so that the output devices operate in the correct sequence. (A0 is the least significant bit of the memory address.) Note: Logic 1 in a memory location will operate the device connected to the location. Memory Address Memory contents D3 [Buzzer] D2 [Oven] D1 [Solenoid] D0 [Green LED] 1 0 1 1 000 001 010 011 [4] (c) Give one advantage of using a Memory IC rather than logic gates for this control system. ................................................................................................................................................ ................................................................................................................................................ [1] (d) The solenoid is rated at 12V, 3 amp. Complete the following circuit diagram to show how the D1 output of the memory IC can be interfaced to the solenoid. +12V D1 output of Memory IC 0V [3] 39 GCSE Electronics. Unit E2 : Applications of Electronics 7. A memory IC has sixteen 4-bit memory locations. It is used to control a level crossing on a model railway. As a train approaches the level crossing the following sequence of steps is triggered: Step Step 1 Step 2 Step 3 Step 4 Step 5 Action barrier is up; bell sounds. “barrier down” motor on; bell sounds; lights flash. barrier is down; lights flash. “barrier up” motor on; lights flash. barrier is up. The diagram shows how the memory is connected to the output devices. The bell is connected to the most significant bit. (a) Complete the table below with binary code needed to run the correct sequence. Step 1 of the sequence has been completed for you. Note: Logic level 1 in a particular memory location will operate the output device connected to that location. Memory Address 0000 Memory contents 1 0 0 0 0001 0010 0011 0100 [4] 40 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. (b) A 4-bit binary counter is used to access each of five memory locations in turn. In the following diagram, A is the least significant bit. The counter is reset by taking the reset pin to logic 1. (c) Show the connections to the AND gate needed so that the counter counts up to 5 in binary and then resets to zero on the sixth clock pulse. [3] Each of the four output devices is to be interfaced to the memory IC. Draw a circuit diagram to show how a 12V, 500mA motor can be controlled by the memory IC. The memory IC has a maximum output current of 20mA. [4] 41 GCSE Electronics. Unit E2 : Applications of Electronics 8. The diagram shows the contents of part of a memory IC. It is used to control a set of LEDs The memory stores the following data: A2 0 0 0 0 1 1 (a) A1 0 0 1 1 0 0 A0 0 1 0 1 0 1 D3 0 1 1 1 0 D2 0 1 1 0 1 D1 1 1 0 0 1 D0 1 1 0 1 0 Key: A = Address D = Data Reset How many LEDs can be controlled separately by this section of the memory IC? Answer ......................... [1] (b) How many memory locations are used to store this part of the LED sequence (including ‘Reset’) ? Answer ................... [1] (c) How many separate address locations can be identified using three address bits? Answer ................... [1] 42 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. (d) The block diagram for the control system is shown below. The system needs a circuit added to make it reset properly. The counter must reset when memory location 1 0 1 is addressed. The counter resets when the reset pin receives a logic 1 signal. Complete the following circuit diagram to show: What type of logic gate is used (using the correct symbol); How the inputs of the logic gate are connected to the counter outputs; How the output of the logic gate is connected to the counter. [4] 43 GCSE Electronics. Unit E2 : Applications of Electronics 9. The block diagram shows how a disco light sequence can be generated using a memory IC. The memory stores the following data: A2 0 0 0 0 1 1 (a) A1 0 0 1 1 0 0 A0 0 1 0 1 0 1 D3 0 1 1 0 1 D2 1 0 1 1 1 D1 0 1 1 1 1 D0 1 0 0 1 1 Reset How many lamps can be controlled separately by this system? ......................... [1] (b) How many separate steps (patterns) are stored in this sequence? Choose your answer from the following options: A. 3 B. 4 C. 5 D. 6 E. 8 F. 16 Answer ................... [1] (c) This memory IC has 3 address pins A2, A1, and A0. What is the maximum number of steps that can be stored in this IC? A. 3 B. 4 C. 5 D. 6 E. 8 F. 16 Answer ................... [1] (d) A disco light sequence can be generated using a logic system instead of the memory IC. What is the advantage of using the memory IC? .............................................................................................................................................................. .............................................................................................................................................................. [1] 44 Topic 2.5 – Programmable Control Systems. 2.5.1 Sequence Controllers. Self Evaluation Review Learning Objectives My personal review of these objectives: understand the procedure needed to write and read content to memory addresses; design and analyse systems that use a memory IC as a programmable logic device. Targets: 1. ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… 2. ……………………………………………………………………………………………………………… ……………………………………………………………………………………………………………… 45