Vienlusčių įtaisų projektavimas

Panašūs dokumentai
Programų sistemų inžinerija Saulius Ragaišis, VU MIF

Civilinės aviacijos administracija

Priedai

AB Linas Agro Group 2018 m. spalio 31 d. eilinio visuotinio akcininkų susirinkimo BENDRASIS BALSAVIMO BIULETENIS GENERAL VOTING BALLOT at Annual Gener

MUITINĖS DEPARTAMENTAS PRIE LIETUVOS RESPUBLIKOS FINANSŲ MINISTERIJOS BENDRO NAUDOTOJŲ VALDYMO SISTEMOS, ATITINKANČIOS EUROPOS KOMISIJOS REIKALAVIMUS,

Algoritmai ir duomenų struktūros (ADS) 7 paskaita Saulius Ragaišis, VU MIF

DB sukūrimas ir užpildymas duomenimis

Neiškiliojo optimizavimo algoritmas su nauju bikriteriniu potencialiųjų simpleksų išrinkimu naudojant Lipšico konstantos įvertį

NEPRIKLAUSOMO AUDITORIAUS IŠVADA UAB Vilniaus gatvių apšvietimo elektros tinklai akcininkui Nuomonė Mes atlikome UAB Vilniaus gatvių apšvietimo elektr

Java esminės klasės, 1 dalis Išimtys, Įvestis/išvestis

PowerPoint Presentation

AB Linas Agro Group 2018 m. spalio 31 d. eilinio visuotinio akcininkų susirinkimo BENDRASIS BALSAVIMO BIULETENIS GENERAL VOTING BALLOT at Annual Gener

SPECIALIOSIOS UŽDAROJO TIPO PRIVATAUS KAPITALO INVESTICINĖS BENDROVĖS INVL TECHNOLOGY AUDITO KOMITETO NUOSTATAI BENDROJI DALIS 1. Šie specialiosios už

AVK SUPA PLUS COUPLING 621/61 Tensile, for PE and PVC pipes, NF approved EPDM sealing 001 AVK Supa Plus is a range of tensile couplings, flange adapto

DBVS realizavimas Pagrindiniai DBVS komponentai Duomenų saugojimas diske Paruošė J.Skučas

Slide 1

Microsoft Word - 15_paskaita.doc

Masyvas su C++ Užduotys. Išsiaiškinkite kodą (jei reikia pataisykite) ir paleiskite per programą. Ciklo skaitliuko įrašymas į vienmatį masyvą: #includ

4 skyrius Algoritmai grafuose 4.1. Grafų teorijos uždaviniai Grafai Tegul turime viršūnių aibę V = { v 1,v 2,...,v N } (angl. vertex) ir briaun

Logines funkcijos termu generavimo algoritmas pagristas funkciniu modeliu

DARBO SUTARTIS

K9 WebProtection (toliau K9) programa yra nemokama asmeniniam naudojimui. Programa suderinama su Windows Vista, Windows 7, Windows 10 ir Mac operacinė

EUROPEAN KARATE ORGANIZATION KUMITE COMPETITION REGULATION AND RULES EKO Referee Committee September 16, 2017, Stockholm Sweden/October 20, 2

Slide 1

274 PRIEDAI K priedas. Elektroninio vartotojo gyvavimo ciklo tyrimo duomenų charakteristikos K.1 lentelė. Klausimyno dalies, skirtos elektroninio vart

Register your product and get support at Indoor wireless headphones SHC8535 SHC8575 LT Vartotojo vadovas

Microsoft Word - SDH2.doc

LT _0704 UG Beo5.indd

Microsoft Word - Deposits and withdrawals policy 400.doc

CompoundJS Node on rails

Pardavimų aplikacija (Microsoft Dynamics AX (Axapta) sistemai) Diegimo instrukcija bifree.lt qlik.com

Algoritmø analizës specialieji skyriai

LIETUVOS RESPUBLIKOS VALSTYBINIO PATENTŲ BIURO DIREKTORIAUS

RR-GSM_IM_LT_110125

CERTIFICATE OF CONFORMITY EU INPUTS Document number: CE The CAAE Certification Service as an authorized certification entity in the Europe

Ekonomikos inžinerija, Globalioji ekonomika NR. Baigiamojo darbo temos pavadinimas Baigiamojo darbo vadovas, kontaktai 1. Globalizacijos poveikis X se

Turinys Bendrovės vadovo žodis...2 Bendrovės valdymo struktūra...4 Bendrovės pagrindinės veiklos pobūdis...6 Bendrovės 2008 metų veiklos apžvalga...8

A-M-K_nr-10_maketas_I.indd

PowerPoint Presentation

PRATYBOS PASAULIO PAŽINIMAS Gegužė Mus supantys ženklai Ženklai mums padeda 1 Kokius ženklus derėtų pakabinti, kad pagerintume paveikslėliuose vaizduo

PATVIRTINTA: LASF žiedo komiteto, Originali teksto kalba - lietuvių. The original text language is Lithuanian Turinys (Content) 1. TAISYKLĖSE NAUDOJAM

Klausimas: Could you please provide clarity to one section of the tender document? In the document it states (using a google translator) Before enteri

Longse Wi-Fi kameros greito paleidimo instrukcija 1. Jums prireiks 1.1. Longse Wi-Fi kameros 1.2. Vaizdo stebėjimo kameros maitinimo šaltinio 1.3. UTP

MHAIA Estimation of Production rd Stage

Viesasis Nr. 17_tirazui.p65

Automatinis skolinimas Automatinio skolinimo paslauga automatiškai teikia pasiūlymus paskolų prašymams pagal Jūsų pasirinkto portfelio rinkinio nustat

Slide 1

rp_ IS_2

LIETUVOS AGRARINĖS EKONOMIKOS INSTITUTAS

TUKE_isakymas_2015.docx

Elektroninio dokumento nuorašas LIETUVOS RESPUBLIKOS ŠVIETIMO IR MOKSLO MINISTRAS ĮSAKYMAS DĖL ŠVIETIMO IR MOKSLO MINISTRO 2011 M. KOVO 16 D. ĮSAKYMO

VIZOS GAVIMAS-INFO

Layout 1

CDK4/6 kelio aktyvacija onkologijoje, molekulinių biomarkerių detekcija ir jų inhibicijos biologija Vaidas Dirsė, Rimvydas Norvilas

RYŠIŲ REGULIAVIMO TARNYBOS

Prekybos terminalas yra naujas ir galingas MetaTrader papildinys

LIETUVOS RESPUBLIKOS ŠVIETIMO IR MOKSLO MINISTRO

Algoritmai ir duomenų struktūros (ADS) 2 paskaita Saulius Ragaišis, VU MIF

Slide 1

P. Kasparaitis. Praktinė informatika. Skriptų vykdymas ir duomenų valdymas Skriptų vykdymas ir duomenų valdymas Įvadas Skripto failas tai M

PR_COD_1amCom

A-M-K_nr-11_maketas_trump.indd

Informacijosmokslai50-n.indd

VILNIUS GEDIMINAS TECHNICAL UNIVERSITY Vytautas DUMBLIAUSKAS DEVELOPMENT AND APPLICATION OF TOUR-BASED TRAVEL DEMAND MODEL FOR PLANNING OF URBAN TRANS

1

Microsoft Word - T-Krivousas_magistrinis.doc

Title

Lietuvos mobiliojo ryšio operatorių 30Mbit/s zonų skaičiavimo metodika

GPU

MAGENTO 1.9 OMNIVA MODULIO DIEGIMO INSTRUKCIJA

Bioness

Vertimas iš anglų kalbos Question: Could you please provide clarity to one section of the tender document? In the document it states (using a google t

PowerPoint Presentation

JABRA REVO WIRELESS Naudotojo Vadovas jabra.com/revowireless

Slide 1

PRESENTATION NAME

Estijos bendrasis ugdymas –Socialiniai mokslai

Transkriptas:

Vienlusčių įtaisų projektavimas 5 paskaita

Baigtiniai būsenų automatai Baigtinis būsenų automatas: angl. Finite State Machine (FSM) FSM yra nuosekliai būsenas keičiantis automatas su "atsitiktine" kitos būsenos logika Naudojamas implementuoti sistemos funkcijas, kurios yra įgyvendinamos įvykdant tam tikrų žingsnių seką. Dažniausiai FSM naudojami kaip sudėtingos sistemos valdymo blokai. Būsenų pokyčiai FSM viduje yra sudėtingesni nei įprastiniuose sekvencinės logikos įrenginiuose, pvz. postūmio registruose FSM yra apibrėžiamas penkiais dalykais: būsenų aibe, įvadais, išvadais, kitos būsenos funkcija ir išvadų funkcija. Mealy (Mylio) ir Moore (Mūro) išvadų palyginimas: 2

Terminai FSM (Finite State Machine) baigtinis būsenų automatas ASM (Algorithmic State Machine) algoritminis būsenų automatas Symbolic state (simbolinė) būsena Input signal įeinantis signalas (įvadas) Output signal išeinantis signalas (išvadas) Next-state function kitos būsenos funkcija Output function išvado (išėjimo) funkcija Node viršūnė Arc lankas, linija Moore output Mūro išvadas (išėjimas) Mealy output Mylio išvadas (išėjimas) Asserted output išvadas, kuriame nustatytas aukštas (1) lygis 3

Finite State Machines State diagram expr mealy <= val to other state state_name moore< = val expr mealy <= val to other state A node represents a unique state An arc represents a transition from one state to another Is labeled with the condition that causes the transition Moore outputs are shown inside the bubble Mealy outputs are shown on the arcs Only asserted outputs are listed Consider a memory controller that sits between a processor and a memory unit Commands include mem, rw and burst mem is asserted when a memory access is requested rw when 1 indicates a read, when 0 indicates a write burst is a special read operation in which 4 consecutive reads occur Two control signals oe (output enable) and we (write enable) One Mealy output we_me

Finite State Machines The controller is initially in the idle state, waiting for mem to be asserted Once mem is asserted, the FSM inspects the rw signal and moves to either the read1 or write state on rising edge of clk The logic expressions are given on the arcs They are checked on the rising edge of the clock For example, if mem is asserted and rw is 1, a transition is made to read1 and the output signal oe is asserted

Finite State Machines Algorithmic State Machine (ASM) chart Flowchart-like diagram with transitions controlled by the rising edge of clk More descriptive and better for complex description than state diagrams state_name state box T moore <= val decision box boolean cond. F mealy <= val conditional output box Each state box has only one exit and is usually followed by a decision box Conditional output boxes can only follow decision boxes and list the Mealy outputs that are asserted when we are in this state and the Boolean condition(s) is true EVERYTHING that follows a state box (to the next state) is next-state combo. logic!

Finite State Machines Conversion between state diagrams and ASMs Conversion process is trivial for the left example For right example, a decision box is added to accommodate the conditional transition to state s1 when a is true. A conditional output box is added to handle the Mealy output that depends on both state_reg=s0 and a= 1

Finite State Machines More examples The same general structure is apparent for either state diagrams or ASMs The biggest difference is in how the decisions and conditional outputs are expressed When we code this in Verilog, you must view the decision and conditional output logic following a state (up to the next state(s)) as combinational next-state logic

Finite State Machines Memory controller conversion

Finite State Machines Basic rules: For a given input combination, there is one unique exit path from the current ASM block The exit path of an ASM block must always lead to a state box. The state box can be the state box of the current ASM block or a state box of another ASM block. Incorrect ASM charts: There are two exit paths (on the left) if a and b are both 1 and NO exit path (on the right) when a is 0

Finite State Machines How do we interpret the ASM chart At the rising edge of clk, the FSM enters a new state (a new ASM block) During the clock period, the FSM performs several operations It activates Moore output signals asserted in this new state It evaluates various Boolean expressions of the decision boxes and activates the Mealy output signals accordingly At the next rising edge of clk (the end of the current clock period), the results of Boolean expression are examined simultaneously An exit path is determined and the FSM stays or enters a new ASM block Timing analysis of an FSM (similar to regular sequential circuit) inputs clk next state logic state_next d q state reg. Mealy output logic state_reg Moore output logic Mealy outputs Moore outputs

Mealy vs Moore Consider an edge detection circuit The circuit is designed to detect the rising edge of a slow strobe input, i.e., it generates a "short" (1-clock period or less) output pulse The input signal may be asserted for a long time (think of a pushbutton) -- the FSM has one state for long duration 0 s and one state for long duration 1 s The output, on the other hand, responds only to the rising edge and generates a pulse of much shorter duration

Mealy vs Moore The left-most design above is a Moore implementation, which additionally includes an edge state Middle design is a Mealy machine The output p2 goes high in the zero state when strobe becomes 1 (after a small propagation delay), and stays high until the transition to state one on the next rising edge

Mealy vs Moore The right-most design includes both types of outputs and adds a third state delay The state diagram asserts p3 in the zero state (as in second version) when strobe goes high and transitions to delay state But since both transitions out of the delay state keep p2 asserted, this has the effect of adding a clock cycle to p2 s high state (as in the first version) Since the assertion is on all outgoing arcs, it is high independent of the input conditions (and can be added inside the bubble as a Moore output) All three designs generate a shot pulse but with subtle differences -- understanding these differences is key to deriving a correct and efficient FSM There are three main differences between Mealy and Moore: Mealy machine uses fewer states -- the input dependency allows several output values to be specified in the same state Mealy machine responds faster -- one clock cycle earlier in systems that use output Mealy machine may be transparent to glitches, i.e., passing them to the output

Mealy vs Moore So which one is better? For control system applications, we can divide control signals into two categories, edge sensitive and level sensitive An edge sensitive signal (e.g., the enable signal on a counter) is sampled only on the rising edge of clock Therefore, glitches do NOT matter -- only the setup and hold times must be obeyed Both Mealy and Moore machines can generate output signals that meet this requirement However, Mealy machines are preferred because it responds one clk cycle faster and uses fewer states For a level sensitive control signal, the signal must be asserted for a certain interval of time (e.g., the write enable signal of an SRAM chip) and Moore is preferred While asserted, it MUST remain stable and free of glitches

FSM projektavimas Verilog'u Reikia registro aktyviai būsenai saugoti: always @(posedge clk) - vienas sekvencinis blokas, kuriame nustatoma aktyvi būsena Reikia kitos būsenos nustatymo funkcijos: always @(*) vienas kombinacinės logikos blokas, kuriame sprendžiama kita būsena Reikia išvadų nustatymo funkcijų: always @(state) Moore išvadams always @(*) arba assign Mealy išvadams 5

Galimų būsenų sąrašas Modulio viduje naudojamas localparam, kurio pagalba išvardinami būsenų pavadinimai ir reikšmės. Priklausomai nuo FSM savybių, būsenos gali būti koduojamos skirtingai: 6

Būsenos registras Reikalingi du registrai: state aktyvi sistemos būsena nextstate suformuota kita sistemos būsena Aktyvi būsena keičiama naudojant kitos būsenos formavimo funkciją: sistemos perkrovimo atveju aktyvuojama pradinė būsena kitais atvejais aktyvuojama suformuota kita būsena 7

Kitos būsenos funkcija Naudojama kombinacinės logikos funkcija (t.y. be atminties elementų) Funkcijos parametrai: aktyvi būsena, įvadų reikšmės Funkcijos rezultatas: kitos būsenos reikšmė Funkcijos aprašymui galima naudoti assign sakinius, tačiau jie per daug paprasti ir nelankstūs. Todėl rekomenduojama visada naudoti always @(*) blokus: jie leidžia aprašyti sudėtingų sąlygų tikrinimą juose galima naudoti if sakinius juose galima naudoti case sakinius 8

always @(*) blokas Naudojamas aprašant kombinacinės logikos funkcijas. Visada aktyvus, kaip ir assign sakiniai. Funkcijos rezultato reikšmei nustatyti naudojamas priskyrimo operatorius '='. Ta pati reikšmė gali būti nustatyta kelis kartus: Pvz. keliose if struktūros šakose. Paskutinė priskirta reikšmė tampa galutiniu funkcijos rezultatu. Visų rezultatų reikšmės turi būti nustatytos bent vieną kartą: Nepriklausomai nuo to, kaip vykdomi if ir case sakiniai. Priešingu atveju funkcijos rezultatas bus neapibrėžtas. Jei yra galimybė, patogu standartinę reikšmę nustatyti pačioje tikrinimo pradžioje, o vėliau ją modifikuoti pagal sąlygas if arba case struktūrose. 9

Kitos būsenos funkcija Bloko viduje išvardinamos visos būsenos. Patogu naudoti case struktūrą. Jei būsena nekeičia standartinės nextstate reikšmės, ji paliekama tuščia. 10

Moore išvadų nustatymo funkcija Naudojamas always @(state) blokas Galima naudoti standartines reikšmes ir jas override'inti 11

Mylio išvadų nustatymo funkcija Naudojamas always @(*) blokas Gali būti keli tokie kombinacinės logikos blokai 12

FSM modeliavimas 13

Pabaiga 14