Presentation is loading. Please wait.

Presentation is loading. Please wait.

RTL Design Introduction Decoder Encoder Multiplexer Tri-state Buffer Look up Table 1.

Similar presentations


Presentation on theme: "RTL Design Introduction Decoder Encoder Multiplexer Tri-state Buffer Look up Table 1."— Presentation transcript:

1 RTL Design Introduction Decoder Encoder Multiplexer Tri-state Buffer Look up Table 1

2 INTRODUCTION So far all we have shown was based on gate level design. When considering functionality of elements as a base of our design, a gate level design isn’t meaningful enough. 2 We will concentrate on functional packages from now on. This level of design referred to as RTL (Register Transfer Level) design and the components which are called RTL components are divided into combinational and sequential types All of this certainly doesn’t mean our need for gates and transistors has been eliminated, especially when matching is needed between RTL components (glue logic) All of this certainly doesn’t mean our need for gates and transistors has been eliminated, especially when matching is needed between RTL components (glue logic) RTL level component Definition Structure Cascading Configuration Verilog Application RTL level component Definition Structure Cascading Configuration Verilog Application

3 Decoder We’ll introduce this package by examining a binary decoder 3 1 0 0 0 0 1

4 Decoder( cont. ) The decoder shown in the last slide is known as a 2-to-4 decoder and a simple structure for it can be the following circuit en 1001000 1010100 1100010 1110001 0--0000 4 Problems can occur in such a design. Firstly we have used and gates (constructed of nand + inverter in CMOS) when we don’t know whether or not the user of our package really needs active-high outputs. We have also, for the same reason, used a lot of pull ups and pull downs and an excessive use of transistors To resolve the mentioned problems, we change the And gates to Nand gates and so our truth table will be changed en 1000111 1011011 1101101 1111110 0--1111 Such a package still isn’t general as such and needs to have the ability of cascading, for the user to be able to construct larger decoders through combining smaller ones. Adding an extra input for enabling/disabling the output will help us in this arena as we will show later on module dcd2to4(input l0,l1,en,output [3:0]y); assign y=(en==1'b0)?4'b1111: ({l0,l1}==2'b00)?4'b1110: ({l0,l1}==2'b01)?4'b1101: ({l0,l1}==2'b10)?4'b1011: ({l0,l1}==2'b11)?4'b0111:4'b1111; endmodule module dcd2to4(input l0,l1,en,output [3:0]y); assign y=(en==1'b0)?4'b1111: ({l0,l1}==2'b00)?4'b1110: ({l0,l1}==2'b01)?4'b1101: ({l0,l1}==2'b10)?4'b1011: ({l0,l1}==2'b11)?4'b0111:4'b1111; endmodule

5 Decoder ( cont. ) 5 Looking at our design so far may cause some new questions. For instance have we told our user that any signal feeds to the EN input has been used to drive 4 gates? Have we not misled the user by not using a standard method? There can be two possible ways to resolve this 1)To document the number of gates a particular input is used to drive 2)A preferable solution is to construct our structure by a convention that no input is used to drive more than one gate. To do this, we need to buffer the EN input through an inverter that will change these inputs’ activity level to low. The same can be done for inputs ‘a’ and ‘b’ without changing their activity level, as shown in the following figure There can be two possible ways to resolve this 1)To document the number of gates a particular input is used to drive 2)A preferable solution is to construct our structure by a convention that no input is used to drive more than one gate. To do this, we need to buffer the EN input through an inverter that will change these inputs’ activity level to low. The same can be done for inputs ‘a’ and ‘b’ without changing their activity level, as shown in the following figure

6 Decoder ( cont. ) We will now show how adding the EN input has given our package the ability of cascading. 6 We’ll show this fact by constructing a 3-to-8 and a 4-to-16 decoder using 2-to-4 decoders

7 Decoder ( cont. ) Decoders can be used to realize switching functions. To do this we will need to OR outputs (relative to the corresponding minterms) of our decoder with an active-low inputs or gate Example 7

8 Decoder ( cont. ) Example(Seven Segment DCD) 8 a b c d e f g en b g a d ec f 01234 98765 error Error will happen when the number is not between 0 and 9

9 Encoder We talked about using a decoder to decode a coded number, obviously there has to also be a way of encoding data as well. 9 1 0 0 0 0 1

10 Encoder ( cont. ) An encoder can find so many uses. For instance consider a stage in a CPU’s working time when two interrupts are sent to it at the same time. One asking for the process of a key press event and the other pointing to a power failure. Obviously in such a situation the first need not be processed because the second interrupt indicates a very severe problem (specially in OSs like Linux). There does actually occur a time when two or more of the inputs are active, we will be using a priority encoder. In such a case the input line with the higher number is chosen to be of higher priority. This means that for instance if we choose X 3 as a power failure interrupt line, no other interrupt request will ever surpass it through priority. 10


Download ppt "RTL Design Introduction Decoder Encoder Multiplexer Tri-state Buffer Look up Table 1."

Similar presentations


Ads by Google