Presentation on theme: "Synchronous logical networks I"— Presentation transcript:
1 Synchronous logical networks I Digital Systems M
2 Asynchronous network problems The behaviour depends on the feedback delays with all related possible malfunctionings (different delays)The behaviour depends on the input hazards (which in any case can’t be exactly concurrent) and prevents the detection of repeated input sequences (i.e. the sequence is the same as )SOLUTIONAn «artificial» input concurrency detection and forced and controlled feedback delays
3 Synchronism signal Z0..m Combinatorial network Y0..k s/r0..k X0..n t FF SR0..ktSynchronism signalIf the pulse is short enough and less than the combinatorial network delay (that is the combinatorial network minimum delay) the new s/r0..k produced by the combinatorial network do not reach the blocking AND before the AND outputs are zeroed making the SR FF stable (the SR FF with both inputs zero doesn’t change status). Only during the following t pulse the new FF outputs values are transmitted to the combinatorial network with no feedabck effets again. Forced feedback alignment.It must be noticed that this way the combinatorial networks inputs too are forcibly «aligned» as far as the status is concerned. No «race» problems (but for the output in the Mealy case)The outputs are almost perfectly aligned (that is they are synchronous) if the sequential machine is Moore type (the outputs depend only from the state variables) and the FFs switch concurrently (which is very likely)
4 Synchronism signalThe synchronism signal is always referred to as clockNormally the clock signal is a regular repetitive square (or rectangular) wave of T period (but not necessarily)A SR FF with a clock signal is referred to as synchronous SR (which in the real systems is never used)What problems arise with the clock signal of the figure ? The pulse duration should be extremely narrow since a combinatorial network can consist even of a single wire and in this case the delay is only the wire propagation delay! In practice it cannot be implementedClockT
5 The synchronous FFsThere are several synchronous FFs but nowadays only the DFF is used whose behaviour was previously analysed as an asynchronous network but which here is used as a synchronous FF (in its 74xx74 version)DQ!QCKThe DFF has this name name because D stands for Delay. In fact the output Q follows the input D with a T period delay (if the input signal is synchronous – that is is generated concurrently with the clock – respecting however setup and hold times – for instance by a network controlled by other DFFs using the same clock) or in presence of the first clock rising edge.The triangle on the clock input (CK) indicates that the FF is edge triggered that is it switches on the positive edge of the clockDQ!QCKPRCLThe signals !CL(ear) and !PR(eset) act asynchronously that is immediately, independently from the clock
6 Combinatorial network The DFF switches ONLY during the transition of CK fro 0 o 1. This corresponds to the very short pulse t seen before. If the transition is fast enough the combinatorial network cannot react before the CK transition is finishedCombinatorialnetworkX0..nZ0..my0..kY0..kClockD0..kQ0..kFFD0..kCKThe clock of the DFF must switch from 0 to 1 only when the combinatorial network is stable (quiet). The transfer of the DFF input to its outputs (transition time) must fast enough to grant the the new D inputs generated by the combinatorial network because of the new values of Yi arrive after the end of the CK transition. Then there is a solid time period for the combinatorial network to reach a new stable state. The period of the CK must be in any case greater than the time required by the combinatorial network to reach its stable state.
8 entity DFF_1 isPort ( D : in std_logic ;CK : in std_logic ;Q : out std_logic;QN : out std_logic );end DFF_1;architecture Behavioral of DFF_1 isbeginprocess_FF: process(CK,D)if (CK'event) and (CK='1') thenQ <= D;QN <= not(D); -- Careful! QN <= not(Q) must not be used !!!!!!-- otherwise QN switch would not be concurrent with Qend if;end process process_FF;end Behavioral;“if (CK'event) and (CK='1')” means that the switch occurs in presence of an edge of CK and the final value is 1 (CK=1). Rising edge !
10 DFF with Set and Reset (VHDL) A_SETDFFA_SETDDQQCKCKQ*QNA_RESA_RESAsynchronous commands A_SET and A_RES have precedence over the other inputsThe two signals must not be activated concurrently (nonsense)In our case we want to model the DFF so as A_RES has precedence over A_SET
11 entity DFF_asynchronous_commands is Port ( CK : in std_logic;D : in std_logic;A_SET : in std_logic;A_RES : in std_logic;Q : out std_logic;QN : out std_logic);end DFF_asynchronous_commands;architecture Behavioral of DFF_asynchronous_commands isbeginProcess_FF: process(CK, A_SET, A_RES, D)-- positive logiceif (A_RES='1') thenQ <='0';QN <='1';elsif (A_SET = '1') then only if A_RES inactiveQ <='1';QN <='0';elsif (CK='1') and (CK'event) thenQ <= D;QN <= not(D);end if;end process process_FF;end Behavioral;
12 higher priority (see VHDL) AsynchronousReset (A_RES=1, A_SET=0)Both asynchronous commands active (A_RES=1, A_SET=1): asynchronous reset hashigher priority (see VHDL)AsynchronousSet (A_RES=0, A_SET=1)Positive logic !
13 Synchronous sequential networks CombinatorialnetworkX0..nZ0..my0..kY0..kClockD0..kQ0..kFFD0..kCKSee the architecture of the asynchronous networks with SR FF feedback where S=!RThe synthesis is performed as in the case of an asynchronous network with direct feedback but inputs remaining constant are considered by the network as different since they are considered in different periods and therefore in presence of possible different states of the FFsWhat matters in this case is the clock positive edge: the time distance between two consecutive rising edges (respecting setup e hold times) DOESN’T countClock period (frequency) must be greater (smaller) than the max combinatorial network delay. The combinatorial network must be stable after a clock positive edge before a new clock positive edge can occurThe clock rising edge differentiates input and output (it separates them from the time point of view)
14 S S* S O S* I CK RC k (k) DFF I O t t+T t+2·T t-T Synchronous Sequential Networks (SSN)k(k) DFFSS*CKRCIOk feedback DFFs All with the same clock of T periodSOS*Itt+Tt+2·Tt-TCKIn this case: Moore or Mealy ?
15 The DFF as fundamental SSN element If a periodic signal is sent to CK (clock) input, the DFF (D = Delay) delays the output signal Q a time equal to the period T if the change of D is logically (but not physically) concurrent with CK (but always respecting setup and hold times)Qn+1 = DnDFFDCKQQ*NB:since here the time is discrete, n and n+1 (periods) are used instead of T e T+tDCKQTNB: The concept of concurrency could seem to be in contrast with the need of respecting setup and hold times. As a matter of fact the inputs of a synchronous network are in the great majority of cases the outputs of other networks which have the same clock and therefore with their delays which grant automatically the respect of setup and hold. Therefore the variations of the inputs are always a little later than the clock edge. See later the behaviour of the shift registers
16 Synchronous Sequential Networks The states changes occur only with the rising edges of the clock and therefore with T period (if the clock is periodical)The network changes its outputs every T and therefore if a very responsive network is required, as far as the outputs are concerned, the Mealy model must be adoptedThe states evolution is independent from the combinatiorial network (provided the distance between the rising edges of the clock is greater that the maximum delay of the combinatorial network)! Thereofre no critical races problemWithin the same system (i.e. a processor) more SSNs are present, not necessarily with the same clockSSNs can be more easily designed than the ASNs
17 Clock gating and clock glitch In the synchronous sequential networks unwanted clock glitches mus be avoided which could induce unwanted DFF switches .For instance because of the different delays of the n signals I[n-1..0] of a decoding network, hazards (glitches) can occur provoking the “clock gating“ effectXCKQQ*FFDDCK_GDecodingnetworkI[n-1..0]PtNO !!CKPCK_GClock glitches → possible unwanted DFF switchObviously it depends on the spurious glich duration: if too narrow the FF could be not triggered (the clock pulse must always have a minimum width which depends on the FF technology: when too narrow either is not sensed by the FF or can cause metastability). The clock gating is not prohibited but is a risk to be avoided when possible.
18 Clock gating and clock glitch For transitions which must or must not take place depending on a decoding network the solution of the figure must be adopted. If the decoding output is 1 Qn+1 = Dn otherwise Qn+1 = Qn1SELFFDDCKQQ*QX1SELtDecodingnetworkQ*CKI[n-1..0]P
19 Clock gating e clock-skew The clock gating, in addition to cause potential glitches produces also a “clock-skew” (disalignmento). Let’s consider two SSN, DFF1 and DFF2I1CKBB*CK_GPI2AA*tANDDFF-1DQQ*DFF-2The two networks clocks are out of phase beacuse of the inserted AND delay time tAND. This phenomenon - clock-skew - is potentially very dangerous since DFF-2 could sample the new (and not the previous) value of DFF-1 albeit the clock should be the sameCKCK_GtANDNB: The “clock-skew” is not only caused by the clock gating but also (for example) by different electrical paths
20 Combinatorial network Combinatorial network Input synchronizationUp to now we have implicitly assumed that the inputs of a synchronous network switch synchronously with the clockThis is true if the inputs come from a Moore type network where the outputs depend only from the state, which switches synchronously with the clock.X0..ny0..kCombinatorialnetworkY0..kDFF0..kD0..kD0..kQ0..kQ0..kCKCKClockCombinatorialnetworkZ0..mAS a matter of fact, the real situation is normally different. Let’s consider for instance a push button as the input of a synchronous network. Its status change can occur any time.In the network of the figure (Moore) the outputs are in any case synchronous with the clock: if the input X0..n change asynchronously from the clock their changes are detected by the network feedback FFs only at the clock positive edge and therefore the network behaviour is the same it would occur if the inputs were synchronous
21 Combinatorial network Input synchronisationThe situation is different however with a Mealy networkZ0..mX0..nCombinatorialnetworkY0..ky0..kD0..kD0..kQ0..kQ0..kCKCKClockFFD0..kIn this case an asynchronous input change triggers, in general, an asynchronous output change
22 … Safe … synchronous….Example: the safe (with a two keys keyboard) opens only if the inputs temporal sequence isEach sequence violation restarts the system. NB Since the inputs are sampled the sequence is possible and meaningful11001100000001A,0B,0C,0D,010E,1For each state ALL input configurations !!01111100111000111000100110010111The states are not necessarily stable for the input configurations which led to themG,010F,0011001NB: It can be assumed that the inputs change concurrently with the state variables but this is not necessary. If the network is Moore type even if the inputs change in the middle of a clock period the behaviour from the state point of view (and therefore from the outputs point of view) is in any case the same (each input variation is sampled only at the period end))
23 Synchronous Safe11B00011110FAGCDEAA-1X1X200A,011B,00000000101C,0D,010E,1111100111001101010010001011100G,010F,001111001NB: in this esample there are not don’t cares for the states. Instead of compatibile states therefore there are equivalent states. In general when two states for the same inputs have the same outputs and lead to the same states or equivalent states they are called indistinguishable. Obviously the system description could include some impossible inputs configurations: in this case we go back to the compatibility concept. The same applies when one ore more outputs are don’t care (a very unlikley situation since all states last one period)
24 Equivalence (not compatibility) classes Synchronous SafeB00011110FAGCDEAA-1X1X2BCDEFGACFFDCDGEDF---C F--b00011110agdeX1X21Equivalence (not compatibility) classes[AFG] => a[B] => b[C] => g[D] => d[E] => eObviously 5 states: 4 belongs to the correct sequence and one is out of itNB: In case of fully specified tables the maximal equivalence classes have NO states in common (the transitive property i valid). Since they are disjoint all of them must be used and therefore there is NO closure problem
25 Synchronous Safe 00 01 11 10 1 a => 000 b => 001 g => 011 deX1X21No race problems: free states coding00100011110000011010100X1X2--1011111101Y1Y2Y3a => 000b => 001g => 011d => 010e => 100Using DFFs the D inputs synthesis is achieved by synthesizing Yi (Yn+1=Dn)D1= X1!X2Y2!Y3D2=!X1X2Y3D3=!X1!X2+!X1!Y2Y3Z =Y1NB: The synthesis is made on the assumption that the opening input configurations follow synchronously with a distance of a period. Should the safe open ONLY when the sequence is correct no matter how many times a single correct input is repeated an auto-ring must be provided in the corresponding state
28 If Mealy ?B00011110FAGCDEAA-1X1X2B,000011110F,0A,0G,0AC,0BD,0CE,1DEA,0A-FGX1X2In this case the safe opens as soon as the input becomes 10 in state D. Obviously this implementations opens the safe one period in advance compared with the Moore implementationSynthesize and simulate with Xilinx
29 Monoimpulsor A D Z Clock Z !Q2 Q1 D Clock The aim is to generate a synchronous output pulse lasting one period when a «1» of an asynchronous input is detected. A further output pulse can be generated only when a «0» input is sampled and then a «1» is sampled again and so onDD1Q1!Q1CKDFFD2Q2!Q2CKDFFZClock(time diagram starts after D=0 for several periods)Z!Q2ComplementQ1DClockHere the asynchronous input D is synchronized by the DFFs.The output Z is synchronous with the clock
30 (A and D indistinguishable) Monoimpulsor A1A,0B,11Moore necessarily if we want the output synchronous with the clock!C,01A-BCDQ2Q11Z00--1011DQ2Q1D 011C 11B 10Z-A 00Q1=D Q2= DQ1 Z=Q1!Q200101101BCDASynchronous network: no races!!ABCD00011011Q2Q11ZSame behaviour!But using D …(A and D indistinguishable)D1Q1!Q1CKDFFD2Q2!Q2ZDClockQ1=D Q2= Q1 Z=Q1!Q2
31 Monoimpulsor B D Z Clock Z !Q2 Q1 D Clock D1 Q1 !Q1 CK DFF D2 Q2 !Q2 A Mealy network: with an asynchronous input we have an asynchronous outputZ lasts a period plus the inizial phase(D>period)Here Z duration depends on the input only(D<period)Z(time diagram starts after D=0 for several periods)!Q2Q1DClock
32 Monoimpulsor C D Z Clock Z Q D Clock DFFZClockMealy network: with an asynchronous input we have an asynchronous outputZ =1 if D=1 and is sampled(time diagram start after D=0 for several periods)ZQDClockAfter the DFF has sampled a 1, if the input oscillates then the output oscillates until the DFF samples a 0
33 Monoimpulsors A, B e CThe exact state diagram corresponding to the real behaviour of monoimpulsors B and C CANNOT be drawn because the two networks (Mealy type) are NOT synchronous. A synchronous state diagram implies that the inputs too are synchronous, which is not the case with B and CThis is not the case of the monoimpulsor A either, since although the input is asynchronous the output (Moore type) depends on the states only. The network behaviour makes internally synchronous the inputs which are physically asynchronousA real state diagram of monoimpulsors B and C can be designed only using an asynchronous analysis, that is “opening” the DFF. Obviously it is always possible to design the two networks without the DFFs starting from an asynchronous traditional states diagram.
34 Monoimpulsor C (asynchronous description): design a network with two inputs C and D and an output Z. The output Z is zero if D=0 independently from C. A transition of C from 0 to 1 samples always D and Z=1 if both the sampled value and D are 1Q=1Q=001,000,0ACD,Z01,0D10,0B11,0C01,000,010,000,010,011,011,-10,-11,111,101,111,1E01,1F00,0G10,0H10,001,100,000,0
35 [ABC] [AD] [EFH] [FG] [ABC] [D] [EFH] [G] a b g d 00 01 11 10 A B C D ----B,0AC,0BCE,-DF,1E,1H,1EG,1FB,-GHBCDEFGA--CEHBHa,000011110b,0ag,---bd,1g,1ga,-dCD[ABC] [AD] [EFH] [FG][ABC] [D] [EFH] [G]a b g d
36 Y1= y2C + y1!C Y2= y2C + D!C Z = y1D 00 01 11 10 a b g d 00,00001111001,0C11,---10,011,111,000,-Dy2y1abgda,000011110b,0ag,---bd,1g,1ga,-dCDY1= y2C + y1!CY2= y2C + D!CZ = y1DThis is the state table of the DFF (see asynchronous networks) with a different outputPost route simulation. Why the behavioural doesn’t function properly?
37 Xilinx Monoimpulsors Input Input: X ( respecting setup and hold times) Multiple outputs:ZA monoimpulsor 'A'ZB monoimpulsor 'B'ZC monoimpulsor 'C‘InputXilinx Monoimpulsors
39 A retriggerable one-shot (trigger => activation signal) is a circuit which generates a Z output pulse lasting T (T presettable) after a positive edge of an input signal X. When another positive edge of X occurs during the pulse Z, the circuit extends the pulse Z of another T time. Design a synchronous retriggerable one-shot (Moore) which using an input signal X asynchronous to the clock (of frequency f=1/T) produces in a retriggerable way a pulse of 3 clock periods, synchronous with the clock.Normal one-shotRetriggerable one-shot3
40 E,0 A,0 B,1 C,1 D,1 F,1 G,1 NB Synchronous output 1 1 X 1 1 1 1 1 The outputs becomes 1 with the first clock positive edge sampling X=1. From each state the number of branches is equal to the number of input configurations !!!1With X=1 at least a three periods outputE,01X111A,0B,1C,1D,111F,1G,1With input=0 the three periods output is in any case produced, which is extended in case an input=1 is sampled againNB Synchronous output
41 All states are distinguishable X1AABBBFC1FGCDCCGD1AFCEAGDEDDAE1EBEEAEFGBCAGBEFDBFGB1AFCBAGDBGBEAGGAB1A B C D E FAll states are distinguishable
42 1 1 1 1 - 1 Z = Y0 + Y1 (Y2 Y2 Y1 Y0)n Y1 Y0 X Y2 (Y2Y1Y0)n+1 Y1 Y0 1Y11Y2Y0)nY1AAB00000000001Y001111011BFC10011010101111-1CGD10101100111DAE10110001001Z = Y0 + Y1EAE100000100FGB11011100011GAB11100000011XY2Y1(Y2Y1Y0)n+1Y00001111000000000100001D2 = !X!Y1Y0 + XY2!Y1!Y0 + XY1Y0 + !X!Y2Y1!Y0D1 = !X!Y2Y1!Y0 + !XY2Y0 + X!Y2!Y1Y0 + X!Y2Y1!Y0D0 = X!Y2!Y1Y0 + XY2Y0 + XY1!Y0 + X!Y2!Y00110111000101011000--100The circuit does’t fully respect the characteristics of a real one-shot since the output pulse doesn’t start immediately upon a an input positive edge but only when the clock samples the input10110000001011(D2D1D0)n
43 Mealy solution E A B C D F G 0,0 1,0 0,0 1,0 X,Z 1,1 1,1 0,0 1,1 0,1
44 Maximal classes A,B,C,(DE),F,G (a,b,c,d,f,g) 1Y11Y0AA,0B,1Ba 000000,0001,1BF,1C,1FGCDCb 001100,1010,1CG,1D,1c 010101,1011,1DDA,0E,0d 011000,0011,0EEA,0E,0FGBCf 100101,1001,1FDBFG,1B,1g 101000,0001,1GGA,0B,1A B C D E FMaximal classes A,B,C,(DE),F,G (a,b,c,d,f,g)In this case too this is not a perfect one-shot:The circuit operates ONLY if the input is sampled (as is the case with Moore) which is not always the caseThe pulse duration is 3 clocks plus the distance between the input activation and the clockIf during a period (i.e. in g -> G) there are input variation these impact directly on the output without waiting for the clock edge!Greater is the clock frequency more the circuit approximates the analog one-shot
45 CountersInputless circuits (but for the clock) in the simplest versionABCDZExample: binary counter x 4 with decoding of 3 (zero…!)00,001,010,011,1D0!Q0Q0CKDFFMUX1D1!Q1Q1(The clock is almost always omitted in the synchronous networks drawings (it is implicit)U0U1CarryQ1 switches when Q0 is 1 (and at the first positive clock edge Q0 switches to 0)
46 Binary counter x 4 with decoding of 3 CKQu1Q0Carry(0)(1)(2)(3)(0)(1)(2)(3)
47 Non 2’s power counters Base 5 binary counter N.B. Q2Q1Q0 D0 !Q0 Q0 CK 000001010011100Base 5 binary counterN.B. Q2Q1Q0D0!Q0Q0CKDFFMUX1D1!Q1Q1D!Q2Q2This counter counts by 8: but in order to count base 5, after 4 (0,1,2,3,4) the counter must be reset
48 Counter x 5MUX1D0!Q0MUX1D1!Q1Q1CKDFFDFFD2!Q2Q2CKDFFQ0CK“3”ABC“4”DecoderWhen the decoder reaches 4 its output becomes zero and therefore all DFF inputs become 0 and upon the first clock positive edge all FFs outpus become 0Synthesize a counter x 100 starting from a set of decimal counters (that is a counter base 1010 to be synthesized ) How many FF for a decimal counter ?
49 Counters with control inputs ENQ0 Q1 Q2 Q3CKLDD0 D1 D2 D3i.e. An integrated counter base 6 with Load and EnableThe counter counts base 16 (0-15!!) if EN = 1. When LD is asserted the input data are inserted in the 4 DFFs (either synchronously or asynchronously). In the previous case the decoder output «4» (positive true) must be connected to LD with all Di zero if LD is synchronous otherwise it is the «5» decoder output which must be connected to LD («5» is therefore an unstable transient state – race problem see later)In general a counter generates a “carry” output which is asserted when the counter reaches the value FH (that is 1510). This output can be connected to the enable of a cascaded counter so as to implement a counter (00 to FF – never forget the zero!) and so on.ENQ0 Q1 Q2 Q3CKCYLDD0 D1 D2 D3There are UP/DOWN counters whose (U/!D) input selects if the counting is up or down. In case of down count the carry is generated when all counters FFs are zero.There is a wealth of different counters, each one with its specific behaviour, with or without RESET (normally asynchronous) , U/!D, with or without LD etc. etc.NB: Each synchronous circuit (with non binary sequence too) whose state diagram can be assimilated to that of a counter IS in any case a counterQ2 Q1 Q0101010000111110Non binary counter x 5
50 Binary counter x 8 with decoding 74163: a 1610 counter with Load, Reset and two anded enables (T and P). The control signals are synchronous that is they act on the clock rising edge74138: decoder 3:8 with negative true outputs if G2A and G2B zero and G1=1. Otherwise all outputs are 1 no matter what is the input
52 What happens for the previous base 5 counter upon the power-on if no RESET is avalable? Unpredictable state which could not belong to the expected cycle.NB The power-on state is absolutely random and depends on the electrical conditions of the circuitLet’ suppose the FFs state is 110 (610, out of the cycle). Let’s analyse the behaviour000001010011100110111Q2Q1Q0101MUX1D0!Q0MUX1DFFD1!Q1Q1CKDFFD2!Q2Q2CKDFFQ0CKABC“4”In this case after a transient behaviour the system re-enters the regular wanted cycle but the behaviour depends on the implementation and with different implementations the three «external states» could be totally separated from the main cycle which would never be reached. RESET signal !!!
53 Sinthesize and simulate As a didactical example only (never to be used !!!!!!) let’s see the transition table of an Up/!Down base 610 counter (0-5 values) with Reset. The input signals are synchronous00011110Up/!Down Res000001010011100101?111110y3 y2 y100011110Up/!Down Res000001010011100101111110y3 y2 y1To compensate the power-on effectSinthesize and simulateHow should the Xilinx schematic modified so as to allow a presetting of the counter?
54 Clock Down Up UP/DOWN counter with Reset «Direct» y2 synthesis Let’s find the states where y2 must assume the value «1»Up/!Down Res00011110y3 y2 y10001010000000011 0010000000000102 0100010000000113 011010000000100UP/!DownD0Q0CKFFDClocky2Decodry3y1“1”“2”“3”“4”1MUX4 100011000000101101100000000000110000000000000111000000000000DownUp
55 Safe again …Using a counter base 8 (but also base 16 etc.) with synchronous reset always enabled how can we implement the opening mechanism of the safe (sequence X1X ) Moore model ?Cx8RESQ0 Q1 Q2CKRES= !(“0”!X1!X2 + “1” !X1X2 + “2” !X1X2 + “3” X1 !X2) - counts «+1» if Reset is not active (it is disabled only if for each counter configuration the right input configuration is inserted)(in any case after the opening the counter is reset )Z = “4” (“0”,”1”,”2”,”3”,”4” are the three outputs binary decoding)The counter is reset whenever the right input (for the particular state) is not fed into the networkThe counter therefore is reset and keeps reset but for the conditions indicated by the function RESAfter reaching 4 (Z=1) the counter is reset upon the following clock positive edgeThe synchronous logical networks are always designed as combinations of standard available blocks and random logic (and, or etc.)ABC“0”“1”“2”“3”“4”RLAND-ORX1X2RESZCx8Q0 Q1 Q2CK
56 CountersWarning !!! Let’s consider the following counter (with asynchronous RESET ) and suppose we want to count base 5 (N.B. for the Reset we must use in this case «5” …. glitch..)ENQ0 Q1 Q2 Q3CKCYRESET“1”Why is this schematic wrong?ABCD“5”But there is a possible critical race !! When a single DFF is reset (and not necessarily at the same instant) the decoder doesn’t decode “5” any more and therefore to some FFs the reset is cancelled. Then ?ENQ0 Q1 Q2 Q3CKCYRESET“1”ABCDRS!Q“5”“0”By so doing “5” activates the SET and the SR FF is not reset until the counter reaches “0”. NB the «wrong» schematic can be used only if the designer is sure of the reset speed of all counter FFSVerify with Xilinx (post route)
57 Safe synthesis with modules DecoderRESET control networkSynchronousRESET counterOutputInitially the counter is reset with input 01, 10 o 11 (all AND outputs are 0 and therefore the NOR is 1 and the Reset is 1). With input 00 the first AND becomes 1, the reset becomes 0 and the counter counts to 1. If then the input is 01 the second AND becomes 1 and the reset is kept 0. Any other inputs reactivates the RESET. This behaviour is repeated until the counter reaches 3: the output becomes then 1 and at the next clock the counter is in any case reset waiting for a successive 00 input.
58 Post-Route simulation As forecasted there are delays between inputs and outputs of each device: the total delay is 10 ns .The initial signals high impedace indicates that the network needs an input for the initial stabilisation before a correct behaviour
59 Direct synthesis (using DFFs, decoders etc) Exercise n.1 – Synchronous networksA logical network must implement a synchronous network based on a binary counter base 4 with synchronous EN and U/!D commands so that the output sequence is(ripetitive)Direct synthesis (using DFFs, decoders etc)Formal Synthesis00100001010001100011011101110111Transition tabley3y2y1z2z100100001101011000011011100101111Another alternative transition tabley3y2y1z2z1001,00001,01001,11001,10y3y2y1100011110Karnaugh Map
60 State tables(to be completed..) Cont x 4Q1Q0U/D*ENDec3FFDQU/!DDMUX1SEL!QThe FF switches only if EN=0What network for EN ? ?Starting from 00 with U/!D=1 the counter counts up keeping EN=1 until 11 is reached (DEC3), when EN becomes 0 and therefore at the next clock the counter doesn’t count while U/!D switches activating DOWN=1 [that is !(U/!D) = 1]. EN becomes then 1 and the counter counts down (as long as DOWN is 1) until 00 when the stall occurs againState tables(to be completed..)Q1 Q0 U/!DEN1..EN= DEC1+DEC2+ DEC3*!(U/!D)+DEC0*U/!D