١٣٨٠/٩/١ اﻣﺘﺤﺎن ﻣﻴﺎن ﺗﺮم درس ﻣﻌﻤﺎری ﮐﺎﻣﭙﻴﻮﺗﺮ )(۴٠٣٢٣ ﻣﺪت ْﺁزﻣﻮن دو ﺳﺎﻋﺖ و ﻧﻴﻢ ) ١۵٠دﻗﻴﻘﻪ( ﻣﯽ ﺑﺎﺷﺪ. ﺗﻌﺪاد ﺳﻮاﻻت ۵ﻋﺪد و در ۴ﺻﻔﺤﻪ ﻣﯽ ﺑﺎﺷﺪ. ﻧﻤﺮﻩ هﺮ ﺳﻮال ﮐﻨﺎر ﺁن ﻧﻮﺷﺘﻪ ﺷﺪﻩ اﺳﺖ و ﻣﺠﻤﻮع ﻧﻤﺮات ٢١ﻣﯽ ﺑﺎﺷﺪ ١) .ﻧﻤﺮﻩ اﺿﺎﻓﯽ( ) ۱/۵ﻧﻤﺮﻩ( -۱ﺍﻋﺪﺍﺩ -36ﻭ -9ﺭﺍ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﺍﻟﮕﻮﺭﻳﺘﻢ Boothﺩﺭ ﻫﻢ ﺿﺮﺏ ﮐﻨﻴﺪ) .ﮐﻠﻴﻪ ﻣﺮﺍﺣﻞ ﺿﺮﺏ ﺭﺍ ﻧﺸﺎﻥ ﺩﻫﻴﺪ(. ) ۲/۵ﻧﻤﺮﻩ( -۲ﻣﯽ ﺧﻮﺍﻫﻴﻢ ﻳﮏ ١۶ ALUﺑﻴﺘﯽ ﺑﺴﺎﺯﻳﻢ ﮐﻪ ﭼﻬﺎﺭ ﺳﻴﮕﻨﺎﻝ ﺣﺎﻟﺖ V, C, S, Zﺭﺍ ﺩﺭ ﺧﺮﻭﺟﯽ ﺧﻮﺩ ﺗﻮﻟﻴﺪ ﮐﻨﺪ .ﺳﻴﮕﻨﺎﻝ Zﻭﻗﺘﯽ ﻓﻌﺎﻝ ﺍﺳﺖ ﮐﻪ ﺧﺮﻭﺟﯽ ﺻﻔﺮ ﺑﺎﺷﺪ .ﺳﻴﮕﻨﺎﻝ Sﻧﺸﺎﻥ ﺩﻫﻨﺪﻩ ﻋﻼﻣﺖ ﺧﺮﻭﺟﯽ ﻣﯽ ﺑﺎﺷﺪ .ﺳﻴﮕﻨﺎﻝ Cﺭﻗﻢ ﻧﻘﻠﯽ ) (Carryﺧﺮﻭﺟﯽ ALUﺍﺳﺖ .ﻭ ﺳﻴﮕﻨﺎﻝ Vﻫﻤﺎﻥ ﺳﺮﺭﻳﺰ ) (Overflowﺍﺳﺖ. ﺍﻟﻒ -ﺍﮔﺮ ﺩﻭ ﻭﺭﻭﺩﯼ ALUﺭﺍ A, Bﻭ ﺧﺮﻭﺟﯽ ﺁﻧﺮﺍ Sﺑﻨﺎﻣﻴﻢ ،ﻭ ALUﻗﺮﺍﺭ ﺑﺎﺷﺪ ﺗﺎ ﻓﻘﻂ ﺍﻋﻤﺎﻝ ﺟﻤﻊ ﻭ ﺗﻔﺮﻳﻖ ﺭﺍ ﺍﻧﺠﺎﻡ ﺩﻫﺪ ،ﻣﺪﺍﺭ ﺑﻠﻮﮐﯽ ﮐﺎﻣﻞ ﺁﻧﺮﺍ ﺑﺼﻮﺭﺕ Carry Lookaheadﻭ ﻫﻤﭽﻨﻴﻦ ﻣﺪﺍﺭ ﺗﻮﻟﻴﺪ ﺳﻴﮕﻨﺎﻟﻬﺎﯼ ﺣﺎﻟﺖ ﺁﻧﺮﺍ ﺑﺎ ﮔﻴﺘﻬﺎﯼ ﻣﻨﻄﻘﯽ ﺭﺳﻢ ﮐﻨﻴﺪ. ﺏ -ﻣﯽ ﺧﻮﺍﻫﻴﻢ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﭼﻬﺎﺭ ﺳﻴﮕﻨﺎﻝ ﺣﺎﻟﺖ ﺗﻮﻟﻴﺪ ﺷﺪﻩ ،ﻣﻘﺎﻳﺴﻪ ﺩﻭ ﻋﺪﺩ A, Bﺭﺍ ﺑﺎ ﻋﻤﻞ ﺗﻔﺮﻳﻖ A-Bﻭ ﻓﺮﻣﻮﻟﻬﺎﯼ ﺟﺪﻭﻝ ﺯﻳﺮ ﺩﺭ ﺩﻭﺣﺎﻟﺖ ﺑﺪﻭﻥ ﻋﻼﻣﺖ ) (unsignedﻭ ﺑﺎﻋﻼﻣﺖ ) (signedﺍﻧﺠﺎﻡ ﺩﻫﻴﻢ .ﻓﻘﻂ ﺑﺎ ﺍﺳﺘﻔﺎﺩﻩ ﺍﺯ ﻳﮏ ROMﺑﺎ ﺣﺪﺍﻗﻞ ﺍﺑﻌﺎﺩ ﻣﻤﮑﻦ ﭼﮕﻮﻧﻪ ﻣﯽ ﺗﻮﺍﻥ ﺍﻳﻦ ﮐﺎﺭ ﺭﺍ ﺍﻧﺠﺎﻡ ﺩﺍﺩ؟ ﺍﺑﻌﺎﺩ ROMﻣﻮﺭﺩ ﺍﺳﺘﻔﺎﺩﻩ ﺭﺍ ﺗﻌﻴﻴﻦ ﮐﻨﻴﺪ ﻭ ﺩﺍﺩﻩ ﻫﺎﯼ ۴ﺧﺎﻧﻪ ﺍﻭﻝ ROMﺧﻮﺩ ﺭﺍ ﻧﺸﺎﻥ ﺩﻫﻴﺪ. Unsigned C = 0 and Z = 0 C=0 C=1 C = 1 or Z = 1 Z=1 Z=0 Signed S xor V = 0 and Z = 0 S xor V = 0 S xor V = 1 S xor V = 1 or Z = 1 Z=1 Z=0 ﻣﻘﺎﻳﺴﻪ A>B A≥B A<B A≤B A=B A≠B ) ۳ﻧﻤﺮﻩ( -۳ﭼﻬﺎﺭ ﻣﺎﺷﻴﻦ ﻣﺨﺘﻠﻒ ﺑﺎ ﻣﺠﻤﻮﻋﻪ ﺩﺳﺘﻮﺭﺍﻟﻌﻤﻠﻬﺎﻳﺸﺎﻥ ﺩﺭ ﺟﺪﻭﻝ ﺯﻳﺮ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﻧﺪ .ﮐﻪ ﺩﺭ ﺁﻧﻬﺎ Mﻧﺸﺎﻥ ﺩﻫﻨﺪﻩ ﺣﺎﻓﻈﻪ ) (Memoryﻭ Riﻧﺸﺎﻥ ﺩﻫﻨﺪﻩ ﺛﺒﺎﺕ ) i (Registerﺍﻡ ﻣﺎﺷﻴﻦ ﻣﯽ ﺑﺎﺷﺪ .ﺑﺮﺍﯼ ﻫﺮﮐﺪﺍﻡ ﺍﺯ ﺍﻳﻦ ﻣﺎﺷﻴﻨﻬﺎ ﺑﺮﻧﺎﻣﻪ ﺍﯼ ﺑﻨﻮﻳﺴﻴﺪ ﮐﻪ ﻋﻤﻞ ) X = (A*(B+C))/(D-E+Fﺭﺍ ﺍﻧﺠﺎﻡ ﺩﻫﺪ. M3 M2 M1 M0 3-Address 2-Address 1-Address 0-Address Load Ri, M Store M, Ri Add Ri, Rj, Rk Sub Ri, Rj, Rk Mul Ri, Rj, Rk Div Ri, Rj, Rk ﺻﻔﺤﻪ ١ Load Ri, M Store M, Ri Add Ri, M Sub Ri, M Mul Ri, M Div Ri, M Load M Store M Add M Sub M Mul M Div M ﻣﺎﺷﻴﻦ ﻧﺤﻮﻩ ﺁﺩﺭﺱ ﺩﻫﯽ Push Mﻣﺠﻤﻮﻋﻪ ﺩﺳﺘﻮﺭﺍﻟﻌﻤﻠﻬﺎ Pop M Add Sub Mul Div اﻣﺘﺤﺎن ﻣﻴﺎن ﺗﺮم درس ﻣﻌﻤﺎری ﮐﺎﻣﭙﻴﻮﺗﺮ )(۴٠٣٢٣ ١٣٨٠/٩/١ ) ۵ﻧﻤﺮﻩ( -۴ﻣﯽ ﺧﻮﺍﻫﻴﻢ ﺩﺭ ﻣﺴﻴﺮ ﺩﺍﺩﻩ ) (Datapathﭼﻨﺪ ﻣﺮﺣﻠﻪ ﺍﯼ ) (Multi Cycleﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺩﺭ ﺷﮑﻞ ﺯﻳﺮ)ﻫﻤﺎﻥ ﻣﺴﻴﺮ ﺩﺍﺩﻩ ﺭﺳﻢ ﺷﺪﻩ ﺩﺭ ﮐﻼﺱ ﺍﺳﺖ ،(.ﺩﺳﺘﻮﺭ SWAPﺭﺍ ﺍﺟﺮﺍ ﮐﻨﻴﻢ .ﮐﺎﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺟﺎﺑﺠﺎ ﮐﺮﺩﻥ ﻣﺤﺘﻮﻳﺎﺕ ﺩﻭ ﺛﺒﺎﺕ ) (Registerﺑﺎ ﻳﮑﺪﻳﮕﺮ ﺍﺳﺖ. ﺍﻟﻒ -ﻣﯽ ﺧﻮﺍﻫﻴﻢ ﺑﺎ ﮐﻤﺘﺮﻳﻦ ﺗﻐﻴﻴﺮ ﺩﺭ ﻣﺴﻴﺮ ﺩﺍﺩﻩ ﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺑﺪﻭﻥ ﺗﻐﻴﻴﺮ ﺩﺭ Register Fileﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺭﺍ ﺍﺟﺮﺍ ﮐﻨﻴﻢ ،ﺗﻐﻴﻴﺮﺍﺕ ﺧﻮﺩ ﺭﺍ ﺑﺎ ﺷﮑﻞ ﻧﺸﺎﻥ ﺩﻫﻴﺪ .ﻧﻮﻉ ﺩﺳﺘﻮﺭ SWAPﻭ ﻫﻤﭽﻨﻴﻦ ﻣﻘﺎﺩﻳﺮ ﻣﺨﺘﻠﻒ ﻓﻴﻠﺪﻫﺎﯼ ) (Fieldsﺁﻧﺮﺍ ﺗﻌﻴﻴﻦ ﮐﻨﻴﺪ ،ﻭ ﺳﻴﮑﻠﻬﺎﯼ ﻣﺨﺘﻠﻒ ﺍﺟﺮﺍﯼ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺭﺍ ﺍﺯ ﺍﺑﺘﺪﺍ ﺗﺎ ﺍﻧﺘﻬﺎ ﺑﺼﻮﺭﺕ RTLﻧﺸﺎﻥ ﺩﻫﻴﺪ. ﺏ -ﭼﮕﻮﻧﻪ ﻣﯽ ﺗﻮﺍﻥ ﺑﺪﻭﻥ ﺗﻐﻴﻴﺮ ﺩﺭ ، Register File, ALUﺗﻨﻬﺎ ﺑﺎ ﺗﻐﻴﻴﺮ ﻋﻨﺎﺻﺮ ﺩﻳﮕﺮ ﻭ ﻳﺎ ﺍﺿﺎﻓﻪ ﮐﺮﺩﻥ ﻋﻨﺎﺻﺮ ﺟﺪﻳﺪ ﺍﻳﻦ ﺩﺳﺘﻮﺭ ﺭﺍ ﺩﺭ ﺳﺮﻳﻌﺘﺮﻳﻦ ﺣﺎﻟﺖ ﻣﻤﮑﻦ ﺍﺟﺮﺍ ﮐﺮﺩ .ﺗﻐﻴﻴﺮﺍﺕ ﺧﻮﺩ ﺭﺍ ﺑﺎ ﺷﮑﻞ ﻧﺸﺎﻥ ﺩﻫﻴﺪ .ﺩﺭ ﺍﻳﻦ ﺣﺎﻟﺖ ﻧﻮﻉ ﺩﺳﺘﻮﺭ SWAPﻭ ﻫﻤﭽﻨﻴﻦ ﻣﻘﺎﺩﻳﺮ ﻣﺨﺘﻠﻒ ﻓﻴﻠﺪﻫﺎﯼ ) (Fieldsﺁﻧﺮﺍ ﺗﻌﻴﻴﻦ ﮐﻨﻴﺪ )ﺍﮔﺮ ﻧﺴﺒﺖ ﺑﻪ ﺣﺎﻟﺖ ﻗﺒﻞ ﺗﻐﻴﻴﺮﯼ ﮐﺮﺩﻩ ﺍﺳﺖ ،(.ﻭ ﺳﻴﮑﻠﻬﺎﯼ ﺍﺟﺮﺍﻳﻲ ﺟﺪﻳﺪ ﺭﺍ ﺑﺼﻮﺭﺕ RTLﻧﻤﺎﻳﺶ ﺩﻫﻴﺪ ALU) .ﺗﻨﻬﺎ ﺍﻋﻤﺎﻝ ﺭﻳﺎﺿﯽ ﺟﻤﻊ ﻭ ﺗﻔﺮﻳﻖ ﻭ ﺍﻋﻤﺎﻝ ﻣﻨﻄﻘﯽ AND, ORﺭﺍ ﻣﯽ ﺗﻮﺍﻧﺪ ﺍﻧﺠﺎﻡ ﺩﻫﺪ(. ) ۹ﻧﻤﺮﻩ( -۵ﭘﺮﺩﺍﺯﻧﺪﻩ ﺍﯼ ۱۶ﺑﻴﺘﯽ ﺑﺎ ﻣﺴﻴﺮ ﺩﺍﺩﻩ ) (Datapathﻧﺸﺎﻥ ﺩﺍﺩﻩ ﺷﺪﻩ ﺩﺭ ﺷﮑﻞ ﺯﻳﺮ ﺑﺎ ﻣﺸﺨﺼﺎﺕ ﺫﮐﺮ ﺷﺪﻩ ﺩﺭ ﺍﺩﺍﻣﻪ ﺩﺍﺩﻩ ﺷﺪﻩ ﺍﺳﺖ: ﺻﻔﺤﻪ ٢ ١٣٨٠/٩/١ (۴٠٣٢٣) اﻣﺘﺤﺎن ﻣﻴﺎن ﺗﺮم درس ﻣﻌﻤﺎری ﮐﺎﻣﭙﻴﻮﺗﺮ ﻭ ﻳﮏA, B ( ﺧﺮﻭﺟﯽPort) ﺑﻴﺘﯽ ﻭ ﺩﻭ ﺩﺭﮔﺎﻩ۱۶ (Register) ﺛﺒﺎﺕ۸ ﺑﺎRegister File .W ﺩﺭﮔﺎﻩ ﻭﺭﻭﺩﯼ .( ﺑﺎ ﻣﺸﺨﺼﺎﺕ ﺫﮐﺮ ﺷﺪﻩ ﺩﺭ ﺟﺪﺍﻭﻝ ﺯﻳﺮShift Unit) SHU ﺑﻴﺘﯽ ﻭ ﻭﺍﺣﺪ۱۶ ALU ALUctrl 000 001 010 011 100 101 110 111 ALU Operation A B A+B A-B NOT A NOT B A AND B A OR B SHUctrl 00 01 10 11 SHU Operation S SHL S LSHR S ASHR S Meaning Pass Input Shift Left Input Logical Shift Right Input Arithmethic Shift Right Input MDR(Memory Data Register), MAR(Memory Address ﺑﻴﺘﯽ۱۶ ﺛﺒﺎﺗﻬﺎﯼ Register), PC, A, B .ﺳﺎﺧﺘﺎﺭ ﺣﺎﻓﻈﻪ ﺑﺎ ﻣﻌﻤﺎﺭﯼ ﻫﺎﺭﻭﺍﺭﺩ :ﻣﺠﻤﻮﻋﻪ ﺩﺳﺘﻮﺭ ﺍﻟﻌﻤﻠﻬﺎﯼ ﺯﻳﺮ op 2 rd 3 rs 3 rt 3 func 3 op = 00 ﺑﺎAL ﺩﺳﺘﻮﺭﺍﺕ ﻧﻮﻉR[rt] <- sh ( R[rs] func R[rd] ) ; PC <- PC + 2 ﺭﻭﯼ ﺁﻧﻬﺎ ﺍﻧﺠﺎﻡ ﺷﺪﻩ ﻭfunc ﺩﺍﺩﻩ ﺷﺪﻩ ﻭ ﻋﻤﻞALU ﺑﻪrd ﻭrs ﺩﺭ ﺍﻳﻦ ﺩﺳﺘﻮﺭﺍﺕ ﺛﺒﺎﺗﻬﺎﯼ ﺩﺭ ﻧﻬﺎﻳﺖ ﻧﺘﻴﺠﻪ. ﺭﻭﯼ ﺁﻧﻬﺎ ﺍﻧﺠﺎﻡ ﻣﯽ ﮔﺮﺩﺩsh ﻓﺮﺳﺘﺎﺩﻩ ﻣﯽ ﺷﻮﺩ ﻭ ﮐﺎﺭSHU ﻧﺘﻴﺠﻪ ﺑﻪ ﻭﺍﺣﺪ . ﺫﺧﻴﺮﻩ ﻣﯽ ﺷﻮﺩrt ﺩﺭ ﺛﺒﺎﺕ ٣ ﺻﻔﺤﻪ sh 2 اﻣﺘﺤﺎن ﻣﻴﺎن ﺗﺮم درس ﻣﻌﻤﺎری ﮐﺎﻣﭙﻴﻮﺗﺮ )(۴٠٣٢٣ Imm8 8 rd 3 rs 3 ١٣٨٠/٩/١ op 2 ﺩﺳﺘﻮﺭ Loadﺑﺎ op = 01R[rd] <- Dmem[ R[rs]+sign_extend(imm8)] ; PC<- PC + 2 ﺍﺯ ﺁﺩﺭﺱ ﺗﻮﻟﻴﺪ ﺷﺪﻩ ﺩﺍﺩﻩ ﺍﺯ ﺣﺎﻓﻈﻪ ﺩﺍﺩﻩ ﺧﻮﺍﻧﺪﻩ ﺷﺪﻩ ﻭ ﺩﺭ ﺛﺒﺎﺕ rdﺫﺧﻴﺮﻩ ﻣﯽ ﮔﺮﺩﺩ. rs 3 Imm8 8 op 2 rd 3 ﺩﺳﺘﻮﺭ Storeﺑﺎ op = 10Dmem[ R[rs]+sign_extend(imm8)] <- R[rd] ; PC<- PC + 2 ﺩﺭ ﺁﺩﺭﺱ ﺗﻮﻟﻴﺪ ﺷﺪﻩ ﻣﺤﺘﻮﺍﯼ ﺛﺒﺎﺕ rdﺩﺭ ﺣﺎﻓﻈﻪ ﺩﺍﺩﻩ ﻧﻮﺷﺘﻪ ﻣﯽ ﺷﻮﺩ. Imm6 6 bv 1 bc 1 bs 1 bz 1 mv 1 mc 1 ms 1 mz 1 op 2 ﺩﺳﺘﻮﺭ Branchﺑﺎ op = 11if (condition) then PC <- PC + 2 + sign_extend(imm6) << 1 else PC <- PC + 2 ﮐﻪ ﺩﺭ ﺁﻥ: condition = (NOT mz OR bz XNOR z) AND (NOT ms OR bs XNOR s) AND )(NOT mc OR bc XNOR c) AND (NOT mv OR bv XNOR v ﺍﮔﺮ ﺷﺮﻁ ﮔﻔﺘﻪ ﺷﺪﻩ ﺩﺭ conditionﻳﮏ ﺑﺎﺷﺪ ،ﭘﺮﺵ ﺷﺮﻃﯽ ﺑﻪ ﺁﺩﺭﺱ ﮔﻔﺘﻪ ﺷﺪﻩ ﺍﻧﺠﺎﻡ ﻣﯽ ﺷﻮﺩ ﻭ ﺩﺭ ﻏﻴﺮ ﺍﻳﻦ ﺻﻮﺭﺕ ﭘﺮﺵ ﺍﻧﺠﺎﻡ ﻧﻤﯽ ﺷﻮﺩ. ﺩﺭ ﻋﺒﺎﺭﺕ ﺷﺮﻁ ﻧﻴﺰ ﺑﻴﺘﻬﺎﯼ z, s, c, vﺧﺮﻭﺟﻴﻬﺎﯼ ALUﻫﺴﺘﻨﺪ. ﺍﻟﻒ -ﻣﺎﺷﻴﻦ ﺣﺎﻟﺖ ﻣﺤﺪﻭﺩ ) (FSMﻭﺍﺣﺪ ﮐﻨﺘﺮﻝ ) (Controllerﺍﻳﻦ ﻣﺎﺷﻴﻦ ﺭﺍ ﺭﺳﻢ ﮐﺮﺩﻩ ﻭ ﺩﺭ ﻫﺮ ﺣﺎﻟﺖ ﺍﻧﺘﻘﺎﻝ ﺛﺒﺎﺗﻬﺎﯼ ﺍﻧﺠﺎﻡ ﺷﺪﻩ ﺭﺍ ﺑﺼﻮﺭﺕ RTLﺑﻨﻮﻳﺴﻴﺪ. ﺏ -ﻣﯽ ﺧﻮﺍﻫﻴﻢ ﻭﺍﺣﺪ ﮐﻨﺘﺮﻝ ﺭﺍ ﺑﺼﻮﺭﺕ Microprogramﺑﺮﻧﺎﻣﻪ ﺭﻳﺰﯼ ﮐﻨﻴﻢ .ﻓﺮﻣﺖ ﺭﻳﺰ ﺩﺳﺘﻮﺭﺍﻟﻌﻤﻞ ) (Micro Instructionﺁﻧﺮﺍ ﻃﺮﺍﺣﯽ ﮐﺮﺩﻩ ﻭ ﺑﮕﻮﻳﻴﺪ ﻫﺮ ﻓﻴﻠﺪ ) (Fieldﺁﻥ ﭼﻪ ﻣﻘﺎﺩﻳﺮﯼ ﺭﺍ ﺑﻪ ﺧﻮﺩ ﻣﯽ ﺗﻮﺍﻧﺪ ﺑﮕﻴﺮﺩ. ﺝ -ﺑﺮ ﺍﺳﺎﺱ ﺭﻳﺰ ﺩﺳﺘﻮﺭﺍﻟﻌﻤﻠﯽ ﮐﻪ ﺩﺭ ﻗﺴﻤﺖ ﺏ ﻃﺮﺍﺣﯽ ﮐﺮﺩﻩ ﺍﻳﺪ ،ﺭﻳﺰ ﺩﺳﺘﻮﺭ ﺍﻟﻌﻤﻠﻬﺎﯼ ﻣﺮﺑﻮﻁ ﺑﻪ ﺩﺳﺘﻮﺭﺍﺕ ﻧﻮﻉ ALﺭﺍ ﻧﺸﺎﻥ ﺩﻫﻴﺪ. ﻣﻮﻓﻖ ﺑﺎﺷﻴﺪ. ﻗﺮﻩ ﺑﺎﻏﯽ ﺻﻔﺤﻪ ۴
© Copyright 2025 Paperzz