Está en la página 1de 8

BO CO BI TP LN : THIT K TNG HP H THNG S

ti : Thit k mch m sn phm

GV hng dn : TS.Nguyn Hong Dng Nhm SV thc hin: 1.Bi Xun Quyt 20092165 2.Nguyn Thanh Tun 20093008 3.Nguyn Danh Dng 20090532

dt09-k54 dt09-k54 dt09-k54

I.Yu cu thit k mch. Thit k mch m hin th trn 2 led 7 thanh trn Kit DE1 s dng ngn ng m t phn cng Verilog. -Mch c cc nt bm: up : nhn up sn phm tng 1 n v. down: nhn down sn phm gim 1 n v. reset: nhn reset sn phm tr v 0. Cc yu cu khc: -Mch v 0 nhn down s gi nguyn trng thi. -Mch v 99 nhn up s gi nguyn trng thi. -Khi thc hin thnh cng trn Kit DE1 chuyn u vo nt up bng h thng thupht hng ngoi. II.S khi. Mch c thc hin trn Kit DE1 nn s khi ch th hin cc khi thit k bng Verilog. S khi:

Thit k tng hp h thng s

Page 1

Chc nng cc khi c thit k: -Khi chia tn : Chia tn s t 50MHz xung tn s thp khong 20Hz. -Khi led n v : m hng n v ca mch, cung cp tn hiu enable up(enable down) cho led chc. -Khi led chc : m hng chc ca mch m. -Khi gii m : gii m tn hiu sang led 7 thanh hin th trn Kit DE1. III.S trng thi. S trng thi khi led n v

Trong : Tn hiu u vo: u-tn hiu up d-tn hiu down z-tn hiu bo led chc trng thi 0 f-tn hiu bo led chc trng thi 9
Thit k tng hp h thng s Page 2

Tn hiu u ra: y-u ra c m ha hin th led n v e_d-u ra cho php led chc nhy trng thi down e_u-u ra cho php led chc nhy trng thi up

S trng thi led chc

Trong : Tn hiu vo: u-tn hiu up e_u: tn hiu cho php up


Thit k tng hp h thng s Page 3

d-tn hiu down e_d-tn hiu cho php down Tn hiu u ra: y-u ra c m ha hin th led chc z-u ra bo led chc trng thi 0 f-u ra bo led chc trng thi 9

IV.Chc nng nguyn l.

-Khi chia tn: Chia tn s ly t Kit DE1 50MHz xung tn s 20Hz-y l tn s xung ng b clk +,Thc hin chia t 50MHz xung 2KHz bng bin m ti 24999 +,Chia tn 2KHz xung 20Hz bng bin m ti 49 Tn s u ra khi chia tn c s dng cho khi led n v v khi led chc -Khi led n v: m hng n v +,tng 1khi c tn hiu up trng thi thp v xung sn ln clk +,gim 1 khi c tn hiu down trng thi thp v xung sn ln ca clk +,khi trng thi 0 ,c tn hiu down trng thi thp,nu c tn hiu bo led chc trng thi 0 th led n v s khng nhy trng thi +, khi trng thi 9 ,c tn hiu up trng thi thp,nu c tn hiu bo led chc trng thi 9 th led n v s khng nhy trng thi -Khi led chc: m led chc:
Thit k tng hp h thng s Page 4

+,tng 1khi c tn hiu up trng thi thp ,tn hiu cho php up trng thi cao v xung sn ln clk +,gim 1 khi c tn hiu down trng thi thp ,tn hiu cho php down trng thi cao v xung sn ln ca clk +,khi trng thi 0,trng thi s khng nhy khi gp tn hiu down +,khi trng thi 9,trng thi s khng nhy khi gp tn hiu up -Khi gii m: Gii m tn hiu u ra y t led n v v led chc hin th trn led 7 thanh. V.Kim tra v m phng. Thc hin test mch v m phng bng Modelsim. Code file test cung cp d liu chy mch : Trong m phng kim tra khi chia tn ch chia 8 , tn s xung clk c ly l 500MHz kt qu hin th d quan st. Bng gn chn KIT DE1 vi u vo up l nt n:
CLOCK_50 HEX0[6] HEX0[5] HEX0[4] HEX0[3] HEX0[2] HEX0[1] HEX0[0] HEX1[6] HEX1[5] HEX1[4] HEX1[3] HEX1[2] HEX1[1] HEX1[0] down rst up Input Output Output Output Output Output Output Output Output Output Output Output Output Output Output Input Input Input PIN_L1 PIN_E2 PIN_F1 PIN_F2 PIN_H1 PIN_H2 PIN_J1 PIN_J2 PIN_D1 PIN_D2 PIN_G3 PIN_H4 PIN_H5 PIN_H6 PIN_E1 PIN_T22 PIN_R22 PIN_R21 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 6 6 6 B2_N1 B2_N1 B2_N1 B2_N1 B2_N1 B2_N1 B2_N1 B2_N1 B2_N0 B2_N0 B2_N0 B2_N0 B2_N0 B2_N0 B2_N1 B6_N0 B6_N0 B6_N0 PIN_L1 PIN_E2 PIN_F1 PIN_F2 PIN_H1 PIN_H2 PIN_J1 PIN_J2 PIN_D1 PIN_D2 PIN_G3 PIN_H4 PIN_H5 PIN_H6 PIN_E1 PIN_T22 PIN_R22 PIN_R21

Hnh nh qu trnh m phng

Thit k tng hp h thng s

Page 5

Thit k tng hp h thng s

Page 6

Gn chn KIT DE1 vi u vo up c ly t khi hng ngoi bn ngoi thng qua chn GPIO : thay u vo up PIN_R21 bng PIN_J22. VI.Kt qu v nh gi. 1.Kt qu. -Mch c hon thin v kim tra thnh cng trn KIT DE1 vi u vo up l nt bm. -Phn khi hng ngoi ang c tin hnh thc hin v kim tra trn KIT DE1 : ti thi im vit bo co cha kim tra thnh cng. 2.nh gi. -u im : mch thc hin c yu cu bi yu cu. -Nhc im : phn code thc hin mch di cn ti thiu code t hiu qu cao hn.

Thit k tng hp h thng s

Page 7

MC LC

I.Yu cu thit k mch1 II.S khi.1 III.S trng thi...2 IV.Chc nng nguyn l...4 V.Kim tra v m phng..5 VI.Kt qu v nh gi.7

Thit k tng hp h thng s

Page 8