You are on page 1of 2

i hc Quc gia H ni Trng i hc Cng ngh Bi thi ht mn

Cng ho x hi ch ngha Vit nam c lp T do Hnh phc

KIN TRC MY TNH


K51 Cng ngh Thng tin, ln I Thi gian : 60 pht, khng k thi gian pht . Tt c cc ti liu c nhn di dng giy u c php s dng, cm trao i ti liu ! Ch phn b thi gian lm bi hp l. Cc ch dn thi gian mi cu ch c tnh gi ! Bi 1. (1 im, ~5 pht) Php tnh cui trong ALU 8 bits, s dng hnh thc biu din b 2 cho s nguyn, l -127-128. Pht biu no l chnh xc trong s nhng pht biu sau v nhng bit trong thanh ghi trng thi: a. Overflow bit = 1, Carry Bit = 1, Zero Bit = 0, Sign Bit = 1. b. Overflow bit = 1, Carry Bit = 0, Zero Bit = 0, Sign Bit = 1. c. Overflow bit = 1, Carry Bit = 1, Zero Bit = 0, Sign Bit = 1. d. Overflow bit = 0, Carry Bit = 1, Zero Bit = 0, Sign Bit = 1. Bi 2. (1 im, ~5 pht) Trong mt pipeline gm 4 tng, mi tng thc thi lnh trong t n v thi gian. Thi gian cn thit thc thi trn vn 4 lnh l ? (b qua ph thuc d liu v r nhnh) a. 16t b. 9t c. 7t d. 6t Bi 3. (2 im, ~10 pht) Xt b nh DDR3 SDRAM c xung nhp ng h b nh l 200MHz, hy tnh thng lng ti a m b nh ny c th t c nu mi t nh c dung lng l 32bits ? Bi 4. (3 im, ~15 pht) Gi s hin thi khng gian b nh chnh ca my in ton c ni dung mt phn nh sau : a ch Ni dung (hexa) 0x00010000 : 0001 0000 0010 A000 0x00010001 : 0002 0000 0011 00B0 0x00010002 : 0001 0000 0011 00B0 Ti thi im xem xt, thanh ghi PC ca b vi x l mang gi tr (0001 0000)H a. Hy v biu lung d liu dch chuyn th hin tng tc gia b vi x l v b nh chnh trong qu trnh thc hin ti lnh k tip ? b. Xc nh r cc gi tr c th ca cc thanh ghi iu khin c bn trong CPU ? Bi 5. (3 im, ~15 pht) Gi s mt CPU c 2 b pipeline: mt dnh cho cc lnh LOAD/STORE v r nhnh, gi chng trnh con, gm 3 tng [FI, DI, EI]; mt dnh cho cc lnh x l d liu gm 4 tng [FI, DI, EI, WO]. Nhng lnh r nhnh v iu kin (unconditional branches) c xc nh ti thi im kt thc tng DI, trong khi nhng lnh r nhnh c iu kin (conditional branches) ch c xc nh khi kt thc tng EI. Cc loi lnh c phn b trung bnh nh sau: 50% lnh l lnh x l d liu, cn li l cc lnh r nhnh, gi chng trnh con. Trong s cc lnh r nhnh, c n 65% l lnh nhy c iu kin (trong s c 80% c thi hnh php nhy). a. Xc nh s chu k (cycles) trung bnh i vi mt lnh (CPI) ca CPU ny nu nh b qua vn ph thuc d liu v r nhnh gia cc lnh. b. Trong trng hp ph thuc d liu c b qua, hy tnh CPI nu pipeline s dng phng php Predict always taken? phng php Predict never taken? ------***------

i hc Quc gia H ni Trng i hc Cng ngh Bi thi ht mn

Cng ho x hi ch ngha Vit nam c lp T do Hnh phc

KIN TRC MY TNH


K51 Cng ngh Thng tin, ln II. Thi gian : 60 pht, khng k thi gian pht . Tt c cc ti liu c nhn di dng giy u c php s dng, cm trao i ti liu ! Ch phn b thi gian lm bi hp l. Cc ch dn thi gian mi cu ch c tnh gi ! Bi 1. (1 im, ~5 pht) Mt my in ton c b nh 2GB c nh a ch theo t nh 32bits v mt b nh cache c dung lng 1MB s dng phng thc nh x trc tip. a ch mt t nh s c phn thnh cc trng nh th no nu kch thc mi block l 16 t nh ? a. Tag = 9bits, Index = 16bits v Block = 4bits. b. Tag = 13bits, Index = 12bits v Block = 4bits. c. Tag = 11bits, Index = 14bits v Block = 4bits. d. Tag = 18bits, Index = 10bits v Block = 4bits. Bi 2. (1 im, ~5 pht) C th xy dng tp lnh 8 bits trong bao gm 3 lnh c format 2 a ch v 8 lnh c format 1 a ch, mi trng a ch c kch thc 3bits, c khng ? a. C b. Tu thuc vo kch thc b nh chnh c. Khng Bi 3. (1 im, ~5 pht) Gi s thanh ghi PC ca CPU cha a ch A1, v ti a ch ny cha lnh I cn mt ton hng. a ch ca ton hng ny l A3. truy cp n a ch ny, lnh I cha thm mt phn xc nh a ch A2. Thanh ghi ch mc (index) ca CPU cha gi tr A4. Hy xc nh mi quan h gia cc a ch trn nu tp lnh CPU s dng c ch nh a ch dch chuyn da trn thanh ghi ch mc? Bi 4. (2 im, ~10 pht) Gi s my tnh RISC vi cc lnh thc thi qua 2 pha : Fetch v Execute, ngoi tr nhng lnh load/store cn thm pha Memory (M). Xt on m sau: 1. LOAD A, M1 2. LOAD B, M2 3. ADD C, A, B 4. STORE C, M3 5. BRANCH M4 Trong M1, M2, M2, M4 l a ch cc t nh. Hy v biu thi gian th hin vic thc thi on m trn trong b pipeline cho ? Xc nh s chu k cn thit thc thi on m trn? Gi thit mi pha thi hnh cn 1 chu k. Bi 5. (2 im, ~10 pht) Hy so snh cc c trng c bn v tp lnh ca nhng my in ton kiu RISC v kiu CISC? Bi 6. (3 im, ~15 pht) Xt on m lnh vit bng ngn ng C di y, c thi hnh trn computer c b nh cache dung lng 2MB s dng phng php nh x kt hp v mi block c kch thc 16 bytes. register int i,j ; //i, j c lu trong cc thanh ghi int A[5][50] ; // int l kiu t nhin ln 32 bits int B[6][101] ; for (i=0 ; i<5 ; i++) for (j=0 ; j<50; j++) A[i][j] = B[j*2][4]*B[j*2+1][4] ; Hy tnh s ln tht bi, cache miss, khi on m ny c thi hnh, gi s ban u b nh cache cha s dng bt k slot no? Gii thch r cc bc tnh ton trong qu trnh nh gi.