浙江工业大学编译原理期终考试命题稿2018-2-A.

合集下载

编译原理期末复习题

编译原理期末复习题

3.2是非判断,对下面的陈述,正确的在陈述后的括号内写T,否则写F。

(1)有穷自动机接受的语言是正则语言。

()(2)若r1和r2是Σ上的正规式,则r1|r2也是。

()(3)设M是一个NFA,并且L(M)={x,y,z},则M的状态数至少为4个。

()(4)令Σ={a,b},则Σ上所有以b为首的字构成的正规集的正规式为b*(a|b)*。

()(5)对任何一个NFA M,都存在一个DFA M',使得L(M')=L(M)。

()(6)对一个右线性文法G,必存在一个左线性文法G',使得L(G)=L(G'),反之亦然。

()答案(1) T (2) T (3) F(4) F (5) T (6) T3.3描述下列各正规表达式所表示的语言。

(1) 0(0|1)*0(2) ((ε|0)1*)*(3) (0|1)*0(0|1)(0|1)(4) 0*10*10*10*(5) (00|11)*((01|10)(00|11)*(01|10)(00|11)*)*答案(1) 以0开头并且以0结尾的,由0和1组成的符号串。

(2) {α|α∈{0,1}*}(3) 由0和1组成的符号串,且从右边开始数第3位为0。

(4) 含3个1的由0和1组成的符号串。

{α|α∈{0,1}+,且α中含有3个1 }(5) {α|α∈{0,1}*,α中0和1为偶数}3.4对于下列语言分别写出它们的正规表达式。

(1) 英文字母组成的所有符号串,要求符号串中顺序包含五个元音。

(2) 英文字母组成的所有符号串,要求符号串中的字母依照词典顺序排列。

(3) Σ={0,1}上的含偶数个1的所有串。

(4) Σ={0,1}上的含奇数个1的所有串。

(5) 具有偶数个0和奇数个1的有0和1组成的符号串的全体。

(6) 不包含子串011的由0和1组成的符号串的全体。

(7) 由0和1组成的符号串,把它看成二进制数,能被3整除的符号串的全体。

答案(1) 令Letter表示除这五个元音外的其它字母。

《编译原理》期末复习资料(完整版)

《编译原理》期末复习资料(完整版)

1.给出语言{a n b n a m b m | n,m≥0}的一个上下文无关文法。

(6分)解:G[S]:S—>ABA—>aAb |εB—>aBb |ε2.给出语言{1 n 0 m 1 m0 n | n,m≥0}的一个上下文无关文法。

解:G[S]:S—>1S0 | AA—>0A1 |ε3.P48 第6题(5)、(6).画语法树6、已知文法G:<表达式>::=<项>|<表达式>+<项><项>::=<因子>|<项>*<因子><因子>::=(<表达式>)|i(5)i+(i+i) (6)i+i*i解:(5)语法树:(6)语法树:4.P48第13题直接短语等13、一个上下文无关文法生成句子abbaa的推导树如下:(3)求直接短语解:直接短语有:a ε bP102例题6.1及其分析.( 后加画语法树)例6.1 设文法G[S]为:(1)S—>aAcBe(2)A—>b(3)A—>Ab(4)B—>d对输入串abbcde#进行分析,检查该符号串是否是G[S]的句子。

步骤符号栈输入符号串动作(1)# abbcde# 移进(2)#a bbcde# 移进(3)#ab bcde# 归约(A—>b)(4)#aA bcde#移进(5)#aAb cde# 归约(A—>Ab)(6)#aA cde# 移进(7)#aAc de# 移进(8)#aAcd e# 归约(B—>d)(9)#aAcB e# 移进(10)#aAcBe # 归约(S—>aAcBe)(11)#S # 接受一、计算分析题(60%)1、正规式→ NFA→ DFA→最简DFAP72第1题(1)、(4);第一题1、构造下列正规式相应的DFA.(1)1(0|1)*101解:先构造NFA0 1S AA A ABAB AC ABAC A ABZABZ AC AB除S,A外,重新命名其他状态,令AB为B、AC为C、ABZ为D,因为D含有Z(NFA的终态),所以0 1S AA A BB C BC A DD C B(4) b((ab)*|bb)*ab解:先构造NFA得到DFA如下所示:P72第4题(a)4、把下图确定化和最小化解:确定化:a b0 01 101 01 11 0、{1},其中A为初态,A,B为终态,因此有:a bA B CB B CC A最小化::初始分划得终态组{A,B},非终态组{C}Π0:{A,B},{C},对终态组进行审查,判断A和B是等价的,故这是最后的划分。

浙江工业大学08级英语(A卷)

浙江工业大学08级英语(A卷)

浙江工业大学08级英语(二)期末考试卷(A)Section I Listening ComprehensionPart AY ou will hear short dialogues below. For each dialogue, there is one question and four possible answers. Choose the correct answer—A, B, C or D. Y ou will have 15 seconds to answer each question and you will hear each dialogues ONLY ONCE.1.Where did Dan and Diane first meet?[A] In a cinema.[B] At a party.[C] In a restaurant.[D] At school.2. What will the woman probably do towards her close friend?[A] Break up with her friend.[B] Shrug her shoulders.[C] Go her own way.[D] Communicate with her friend.3. What relationship was there between the woman and the friend she mentioned when they firstmet?[A] Colleagues. [B] Buyer and seller.[C] Staff and boss. [D] Schoolmates.Part BY ou will hear dialogues and monologues below. Before listening to each one, you will have 5 seconds to read each of the questions which accompany it. While listening, answer each question by choose A, B, C or D. After listening, you will have 10 seconds to check your answer to each question. Y ou will hear each piece ONLY ONCE.Questions 4— 6 are based on a dialogue a man and a woman who just meet for the second time4. What is the woman‟s name?[A] Susan. [B] Sharon.[C] Sherry. [D] Sandy.5. In what field is the woman majoring?[A] Engineering. [B] Accounting.[C] Education. [D] International Business.6. Where does the man invite the woman to at the end of the conversation?[A] A movie. [B] A dance.[C] A party. [D] A concert.Question 7—10 are based on a talk given by a man who introduces himself.7.Where was the man born?[A] Arizona. [B] Colorado.[C] Kansas. [D] New Y ork.8. Which is true of the man?[A] He will graduate this year. [B] He is majoring in Spanish.[C] He doesn‟t like economics. [D] He is a third-year student.9. Where does the man work part-time?[A] At a sore. [B] At a school.[C] At a bank. [D] At a library.10. Which is what the man likes to do in his free time?[A] Camping. [B] Fishing.[C] Hiking. [D] Swimming.Section II Use of EnglishRead the following text. Choose the best word or phrase for each numbered blank.The idea that some groups of people may be more intelligent than others is one of those hypotheses that dare not speak its name. But Gregory Cochran is 11 to say it anyway. He is that 12 bird, a scientist who works independently 13 any institution. He helped popularize the idea that some diseases not 14 thought to have a bacterial cause were actually infections, which aroused much controversy when it was first suggested.15 he, however, might tremble at the 16 of what he is about to do. Together with another two scientists, he is publishing a paper which not only 17 that one group of humanity is more intelligent than the others, but explains the process that has brought this about. The group in 18 are a particular people originated from central Europe. The process is natural selection.This group generally do well in IQ test, 19 12-15 points above the 20 value of 100, and have contributed 21 to the intellectual and cultural life of the West, as the 22 of their elites, including several world-renowned scientists, 23 . They also suffer more often than most people from a number of nasty genetic diseases, such as breast cancer. These facts, 24 , have previously been thought unrelated. The former has been 25 to social effects, such as a strong tradition of 26 education. The latter was seen as a (an) 27 of genetic isolation. Dr. Cochran suggests that the intelligence and diseases are intimately 28 . His argument is that the unusual history of these people has 29 them to unique evolutionary pressures that have resulted in this 30 state of affairs.11. [A] obliged [B] prepared [C] selected [D] pleased12. [A] special [B] particular [C] unique [D] rare13. [A] of [B] in [C] with [D] against14. [A] subsequently [B] previously [C] presently [D] lately15. [A] Only [B] So [C] Even [D] Hence16. [A] thought [B] sight [C] cost [D] risk17. [A] advises [B] suggests [C] protests [D] objects18. [A] progress [B] fact [C] need [D] question19. [A] attaining [B] scoring [C] reaching [D] calculating20. [A] common [B] normal [C] mean [D] total21. [A] unconsciously [B] disproportionately [C] indefinitely [D] unaccountably22. [A] fortunes [B] missions [C] interests [D] careers23. [A] witness [B] affirm [C] observe [D] approve24. [A] however [B] therefore [C] moreover [D] meanwhile25. [A] given up [B] got over [C] put down [D] carried on26. [A] valuing [B] supervising [C] administering [D] assessing27. [A] development [B] origin [C] consequence [D] instrument28. [A] woven [B] integrated [C] linked [D] combined29. [A] limited [B] subjected [C] converted [D] directed30. [A] paradoxical [B] incompatible [C] inevitable [D] continuousSection III Reading ComprehensionPart ARead the following text. Answer the questions by choosing A, B, C or D.AY ou must have been troubled by when to say "I love you" because it is one of the greatest puzzles in our life.What if you say it first and your partner doesn‟t love you back? Or if they do say it, but you don‟t feel they mean it? Being the first to declare your love can be never racking(紧张)and risky and can leave you feeling as vulnerable as a turtle with no shell. But is the person who says it first really in a position of weakness? Doesn‟t it pay to hold back, play it cool and wait until the other half has shown their hand fast?A really good relationship should be about being fair and being equal," says psychologist Sidney Crown. "But love is seldom equal." All relationships go through of ...I‟ve always loved you more‟may be subverted(颠覆,破坏) for a time, but it power struggles but, he says, if a love imbalance continues for years, the rot will set in. "That feeling ever goes away completely and it often emerges in squabbling(大声争吵). " In love, at least, the silent, withholding type is not always the most powerful. "The strongest one in a relationship is often the person who feels confident enough to talk about their feelings," says educational psychologist Ingrid Collins. Psychosexual therapist Paula Hall agrees. "The one with the upper hand is often the person who takes the initiative. In fact, the person who says ...I love you‟ first may also be the one who says ...I‟m bored with you‟ first. " Hall believes that much depends on how "I love you" is said and the motivation of the person saying it. "Is it said when they‟re drunk? Is it said. before their partner files off on holiday, and what it really means is ...Please don‟t be unfaithful to me‟? By saying (I)love you‟, they really saying‟Do you love me?‟If so, wouldn‟t it just be more honest to say mat. Collins agrees that intention is everything. "It‟s not what is said, but how it‟s said. What it comes down to is th e sincerity of the speaker.”31. What is the main idea of this passage?[ A ] The importance of "I love you"[ B ] The meaning of "I love you"[ C ] The time of saying "I love you".[ D ] The place of saying. "I love you"32. In the first sentence the author means that[ A ] it is easy to say "I love you"[ B ] we have many troubles in our life[ C ] it is hard to say "I love you"[ D ] people usually do not know when to say "I love you"33. According to the expert, a good relationship should be[ A ] fair and kind[ B ] fair and equal[ C ] powerful and fair[ D] confident and equal34. In the third paragraph, the phrase "with the upper hand" means[ A ] being only one hand[ B ] having low in spirit[ C ] being passive[ D ] being active35. What is the most important for you to consider when somebody say "I love you" to you?[ A ] The intention.[ B ] The. time.[ C ] The place[ D ] The determination.BFifteen years ago, I entered the Boston Globe, which was a temple to me then. It wasn‟t easy getting hired. But once you were there, I found, you were in.Globe jobs were for life-guaranteed until retirement. For 15 years I had prospered there—moving from an ordinary reporter to foreign correspondent and finally to senior editor. I would have a life- time of security if I stuck with it. Instead, I had made a decision to leave. I entered my boss‟s of- rice. Would he rage? I wondered. He had a famous temper. "Matt, we have to have a talk." I began awkwardly. "I came to the Globe when I was twenty-four. Now I‟m forty. There‟s a lot I want to do in life. I‟m re signing. ""To another paper?" he asked. I reached into my coat pocket, but didn‟t say anything. I handed him a letter that explained everything. It said that I was leaving to start a new media company. We were at a rare turning point in history. I wanted to be directly engaged in the change. "I‟m glad for you," he said, quite out of my expectation. "I just came from a board of directors meeting and it was seventy-five percent discouraging news. Some of that we can deal with. But much of it we can‟t," he went on. "I wish you all the luck in the world," he concluded. "And if it doesn‟t work out, remember, your star is always high here."Then I went out of his office, walking through the newsroom for more good-byes. Everybody was saying congratulations. Everybody--even though I‟d be risking all on an unfamiliar venture: all the financial security I had carefully built up.Later, I had a final talk with Bill Taylor, chairman and publisher of the Boston Globe. He had turned the Globe into a billion-dollar property. "I‟m resigning, Bill," I said. He listened while I gave him the story. He wasn‟t looking angry or dismayed either. After a pause, he said, "Golly, I wish I were in your shoes."36. From the passage we know that the Globe is a famous[ A ] temple[ B ] church[ C ] newspaper[ D ] magazine37. If the writer stayed with the Globe[ A ] he would be able to realize his lifetime dreams[ B ] he would never have to worry about his future life[ C ] he would never be allowed to develop his ambitions[ D ] he would let his long-cherished dreams fade away38. The writer wanted to resign because[ A ] he had serious trouble with his boss[ B ] he got underpaid at his job for the Globe[ C ] he wanted to be engaged in the new media industry[ D ] he had found a better paid job in a publishing house39. When the writer decided to resign, the Globe was faced with[ A ] a trouble, with its staff members[ B ] an unfavorable business situation[ C ] a shortage of qualified reporters[ D ] an uncontrollable business situation40. By "I wish I were in your shoes. " ( in the last paragraph ), Bill Taylor meant that[ A ] the writer was to fail[ B ] the writer was stupid[ C ] he would do the same if possible[ D ] he would reject the writer’s requestCThere was one thought that air pollution affected only the area immediately around large cities with factories and heavy automobile traffic. At present, we realize that although these are the areas with the worst air pollution, the problem is literally worldwide. On several occasions over the past decade, a heavy cloud of air pollution has covered the east of the United States and brought health warnings in rural areas away from any major concentration of manufacturing and automobile traffic. In fact, the very climate of the entire earth may be infected by air pollution. Some scientists consider that the increasing concentration of carbon dioxide in the air resulting from the burning of fossil fuels (coal and oil) is creating a “greenhouse effect”— conserving heat reflected from the earth and raising the world‟s average temperature. If this view is correct and the world‟s temperatur e is raised only a few degrees, much of the polar ice cap will melt and cities such as New Y ork, Boston, Miami, and New Orleans will be in water.Another view, less widely held, is that increasing particular matter in the atmosphere is blocking sunlight and lowering the earth‟s temperature — a result that would be equally disastrous. A drop of just a few degrees could create something close to a new ice age, and would mane agriculture difficult or impossible in many of our top farming areas. Today we do not know for sure that either of these conditions will happen (though one recent government report drafted by experts in the field concluded that the greenhouse effect is very possible) Perhaps, if we are lucky enough, the two tendencies will offset each other and the world‟s temperature will stay about the same as it is now. Driven by economic profits, people neglect the damage on our environment caused by the “advanced civilization”. Maybe the air pollution is the price the human beings have to pay for their development. But is it really worthwhile?41. As pointed out at the beginning of the passage, people used to think that air pollution_______.[ A ] cause widespread damage in the countryside[ B ] affected the entire eastern half of the United States[ C ] existed merely in urban and industries areas[ D ] had damaged effect on health42. As to the greenhouse effect, the author________.[ A ] thinks that it will destroy the world soon.[ B ] is uncertain of its occurrence[ C ] rejects it as being ungrounded[ D ] share the same view with the scientist43. The word “offset”in the second paragraph could be replaced by .[ A] slip into [ B ] make up for[ C ] set up [ D ] catch up with44. It can be concluded that _______.[ A ] raising the world‟s temperature only a few degrees would not do much harm to life on earth.[ B ] lowering the world’s temperature merely a few degrees would lead major farming areas to disaster.[ C ] almost no temperature variations have occurred over the past decade.[ D ] the world’s temperature will remain constant in the years to come.45. This passage is primarily about .[ A ] the greenhouse effect.[ B ] the burning of fossil fuels..[ C ] the potential effect of air pollution.[ D ] the likelihood of a new ice age.Part BRead the text from a magazine article on "smileys". For questions 46 to 50, match the items on the left (46 to 50) to one of the statements (A to G) given below. Mark your answers on your ANSWER SHEET.All over the world these days, email messages are ending with these odd symbols: :-) or :-(. They are "smileys", so called because when you turn your head to the left they look like little faces with eyes and a nose. Thus when a message ends :-) it means "just kidding". If it ends :-( it means "I'm depressed."It was 20 years ago that Scott Fahlman taught the Net how to smile.The Carnegie Mellon computer scientist has devoted his professional life to artificial intelligence, the practice of teaching computers how to think like humans, but he is perhaps best known for his inspiration that helped to define Internet culture.By the early 1980's, the Computer Science community at Carnegie Mellon was making great use of online bulletin boards or "bbs". A good many of the posts are humorous. The problem was that if someone made a joke, a few readers would fail to get the joke. This problem caused some people to suggest (only half seriously) that maybe it would be a good idea to tell the readers that certain posts were not to be taken seriously. After all, when using text-based online communication, we lack the body language or tone-of-voice cues that convey this information when we talk in person or on the phone.So on Sept. 19, 1982, Fahlman typed :-) in an online message. "I had no idea I was starting something that would soon pollute the world's communications channels." This convention caught on quickly around Carnegie Mellon, and soon spread to other universities and research labs through the computer networks of the day. In the two decades since, the smiling symbols have become an important characteristic of online communication. And Fahlman's original smiley face sparked the creation of thousands of smiley face types.But Fahlman has never seen a cent from his creation. "If it cost people a cent to use it, nobodywould have used it. This is my little gift to the world, for better or worse," he said.Note: there are two extra statements.Statements46. smileys A. are ending with smiling symbols47. bbs B. mean “I‟m just kidding."48. Scott Fahlman C. originated in Carnegie Mellon49. email messages D. are allowed to use the smiling symbols with little charge50. the Net E. had its culture defined by a scientist's inspirationF. taught the Net how to smileG. were used greatly by the Computer Science communitySection IV WritingDirections:For this part,you are allowed 30 minutes to write a composition on the topic College Graduates Work as Village Officials. Y ou should write at least 150 words, and base your composition on the outline (given in Chinese) below:1. 你是否认为大学生当村官是个好主意;2. 大学生能给乡村提供些什么;3. 大学生能从村官职位中获得什么。

浙大研究生 2017-2018学年《计算机理论》期末考试英文版及答案

浙大研究生 2017-2018学年《计算机理论》期末考试英文版及答案

浙江大学2017-2018学年秋冬学期《计算理论》课程期末考试试卷课程号:21120520开课学院:计算机学院考试试卷: A卷 B卷考试形式: 闭卷 开卷,允许带入场考试日期:2018年1月24日,考试时间:120分钟诚信考试,沉着应考,杜绝违纪考生姓名学号所属院系题序123456总分得分评卷人Zhejiang UniversityTheory of Computation,Fall-Winter2017Final Exam1.(24pts)Determine whether the following statements are true or false.Ifit is truefill a T otherwise a F in the bracket before the statement.(a)()Let A,B be two languages.If both A and A∪B are regular,then B isdefinitely regular.(b)()If A is regular and B is non-regular,then A◦B must be non-regular.(c)()Language{xcy|x,y∈{a,b}∗,|x|≤|y|≤3|x|}is context-free.(d)()Every regular language can be generated by a context-free grammar.(e)()If A is recursive and B⊆A,then B is recursive as well.(f)()Recursively enumerable languages are always infinite.(g)()There’s a functionφsuch thatφcan be computed by some Turing ma-chines,yetφis not a primitive recursive function.(h)()Let A and B be recursively enumerable languages and A∩B=∅.If A∪Bis also recursively enumerable,then both A and B is decidable.(i)()The language{“M”“w”|TM M accepts w in less than2018steps}isrecursive.(j)()The language{“M”|TM M accepts exactly2018strings}is recursively enumerable but not recursive.(k)()Let H e={“M”|TM M halts on e}.If H e≤L,then L is recursive enumerable but not recursive.(l)()A language L is recursive if and only if it is Turing-enumerable.2.(18pts)On FA and Regular LanguagesSay whether each of the following languages is regular or not regular?Prove your answers,where{a,b}+={a,b}∗◦{a,b}.(a)L1={wtw|w,t∈{a,b}+}(b)L2={wtw|w,t∈{a,b}∗}3.(20pts)On PDA and Context-Free LanguagesLet L3={ww R ca m b n|w∈{a,b}∗,m,n∈N,m=n}.(a)Construct a context-free grammar that generates the language L3.(b)Construct a pushdown automata that accepts L3.Solution:(a)(b)The PDA M=(K,Σ,Γ,∆,s,F)is defined below:(q,σ,β)(p,γ)K=Σ={a,b,c}Γ=s=F=4.(10pts)On Turing MachineDesign a single tape Turing machine M that decides the language L4L4={uvcww R|u,v,w∈{a,b}∗,|u|=2|v|}When describing the Turing machines above,you can use the elementary Turing machines described in textbook.Always assume that your Turing machine starts from the configuration◃⊔x,where x is the input string.5.(10pts)On Primitive Recursive Function→N,and k∈N,k≥2 Show the following functionφk:N×N×···×Nk{n1,n2,···,n k}φk(n1,n2,···,n k)=maxkis primitive recursive.6.(18pts)On UndecidabilityClassify whether each of the following languages are recursive,recursively enumerable but not recursive,or non-recursively enumerable.Prove your answers,but you may not simply appeal to Rice’s theorem.(a)L5={“M”|M is a TM,and L(M)is uncountable}(b)L6={“M”|TM M accepts at least two strings of different lengths}Enjoy Your Spring Festival!。

2021年浙江工业大学网络工程专业《计算机组成原理》科目期末试卷A(有答案)

2021年浙江工业大学网络工程专业《计算机组成原理》科目期末试卷A(有答案)

2021年浙江工业大学网络工程专业《计算机组成原理》科目期末试卷A(有答案)一、选择题1、存储器采用部分译码法片选时,()。

A.不需要地址译码器B.不能充分利用存储器空间C.会产生地址重叠D.CPU的地址线全参与译码2、在对破坏性读出的存储器进行读/写操作时,为维持原存信息不变,必须辅以的操作是()。

A.刷新B.再生C.写保护D.主存校验3、某计算机字长为32位,按字节编址,采用小端(Litle Endian)方式存放数据。

假定有一个double型变量,其机器数表示为1122334455667788H,存放在00008040H开始的连续存储单元中,则存储单元00008046H中存放的是()。

A.22HB.33HC.66HD.77H4、float类型(即IEEE754标准中的单精度浮点数格式)能表示的最大整数是()。

A.2126-2103B.2127-2104C.2127-2105D.2128-21045、某机字长8位,含一位数符,采用原码表示,则定点小数所能表示的非零最小正数为()A.2-9B.2-8C.2-7D.2-66、在集中式总线控制中,响应时间最快的是()。

A.链式查询B.计数器定时查询C.独立请求D.分组链式查询7、控制总线主要用来传送()。

I.存储器和1/O设备的地址码II.所有存储器和I/O设备的时序信号III.所有存储器和1/O设备的控制信号IV.来自I/O设备和存储器的响应信号A.II、IIIB. I,III,IVC. III,IVD.II,III. IV8、在计算机系统中,表明系统运行状态的部件是()。

A.程序计数器B.指令寄存器C.程序状态字D.累加寄存器9、下列部件中,CPU存取速度由慢到快的排列顺序正确的是()。

A.外存、主存、Cache、寄存器B.外存、主存、寄存器、CacheC.外存、Cache、寄存器、主存D.主存、Cache、寄存器、外存10、关于通用寄存器,下列说法正确的是()。

2018年高考真题精校Word版含解析版---英语(浙江卷)

2018年高考真题精校Word版含解析版---英语(浙江卷)
C. She’s helpful.
3. When does the train leave?
A. At 6:30.
B. At 8:does the woman go to work?
A. By car.
B. On foot.
C. By bike.
5. What is the probable relationship between the speakers?
A. Ecology.
B. Education.
C. Chemistry.
听第7段材料,回答第8、9题。
8. What is the man?
A. A hotel manager.
B. A tour guide
C. A taxi driver.
9. What is the man doing for the woman?
第二部分阅读理解(共两节,满分35分)
第一节(共10小题;每小题2.5分,满分25分)
阅读下列短文,从每题所给的A、B、C和D四个选项中,选出最佳选项,并在答题纸上将该项涂黑。
1. What will James do tomorrow?
A. Watch a TV program.
B. Give a talk.
C. Write a report.
2. What can we say about the woman?
A. She’s generous.
B. She’s curious.
A. It’s a good size.
B. It’s newly painted.
C. It’s adequately equipped.
16. What will the woman most probably do next?

浙江工业大学微机原理及应用试卷答案

微机原理练习题一、填空题1.80C51单片机内部 4 KB程序存储器,地址为 0000H 到 0FFFH 。

2.在基址加变址寻址方式中,以 A 作变址寄存器,以 DPTR 或PC作基址寄存器。

3.PSW是程序状态寄存器,其包括RS1、RS0位,这两个位的作用是:确定工作寄存器组。

4.设累加器(A)=7FH,(Cy)=0,则执行DA A指令后,(A)= 85H 。

5.汇编语言指令是由__操作码______和____操作数____两部分组成。

6.MCS-51单片机访问外部存储器时,利用ALE 信号锁存来自P0 口的低8位地址信号。

7.MCS-51的定时/计数器可以有 4 种工作方式,编制程序时需要通过设定 TMOD 特殊功能寄存器的值设定T0和T1的工作方式,当T0需要工作在16位定时器方式,T1工作在8位自动重装方式时,该寄存器值为 21H 。

8.指令“MOV A,@R0”和“MOVX A,@R0”的区别是:前一个内部数据存储器操作,后一个外部数据存储器操作。

9.INT0中断和INT1中断的入口地址分别为0003H 和0013H 。

假设软件设定INT0为低优先级别、INT1为高优先级别,当CPU正在执行INT0中断时,发生了INT1中断请求,CPU应如何响应?先中断INT0中断,先执行INT1中断。

10.MOV C,20H,源操作数的寻址方式为:位寻址方式。

11.假定累加器A的内容30H,执行指令:1000H:MOVC A,@A+PC后,把程序存储器1031H 单元的内容送累加器A中。

二、程序填空、解释程序语句,并填写运行结果1.PROG:MOV 40H,#3AHMOV A ,#08HORL A,#0F0H ;将A的高4位置1MOV 30H,AANL A,#0F0HSW AP A ;A中的高4位与低4位交换MOV 31H,A当执行完以上指令后,填写下面的寄存器或地址中的值:当执行完以上指令后,填写下面的寄存器或地址中的值:(A)= 0FH ;(40H)= 2AH ;(30H)= 0F8H ;(31H)= 0FH 。

浙江工业大学综合英语大一考试真题

浙江工业大学综合英语大一考试真题全文共3篇示例,供读者参考篇1Zhejiang University of Technology Comprehensive English Exam for FreshmanPart I. Reading Comprehension (30 points)Read the following passage and answer the questions below:Ever since its establishment in 1953, Zhejiang University of Technology has been committed to providing high-quality education to its students. The university offers a wide range of undergraduate and graduate programs in various fields such as engineering, business, and the arts. With its state-of-the-art facilities and talented faculty members, Zhejiang University of Technology has earned a reputation for excellence both domestically and internationally.1. When was Zhejiang University of Technology founded?2. What are some of the fields in which Zhejiang University of Technology offers programs?3. What is one of the reasons why Zhejiang University of Technology is known for excellence?Part II. Vocabulary and Grammar (40 points)1. Fill in the blank with the correct form of the word in parentheses:The students _______ (be) to the library every day.2. Choose the correct word to complete the sentence:She _______ her homework before going to bed.a. has finishedb. will finishc. finishesd. finishedPart III. Writing (30 points)Write an essay of at least 200 words on the following topic:The importance of education in the modern world.Part IV. Listening Comprehension (30 points)Listen to the audio recordings and answer the questions that follow.Part V. Speaking (20 points)Interview with a partner about your favorite book and why you like it.Good luck on your exam!篇2Zhejiang University of TechnologyComprehensive English Exam (Freshman)Section A: Reading ComprehensionRead the following article and answer the questions that follow.The Great Wall of China is one of the most famous structures in the world. Stretching over 13,000 miles, it was originally built to protect Chinese emperors from invaders. Construction began over 2,000 years ago, and it is one of the world's largestman-made structures. Today, the Great Wall is a popular tourist destination, attracting millions of visitors every year.Question 1: What was the original purpose of the Great Wall of China?Question 2: How long is the Great Wall of China?Question 3: When did construction of the Great Wall begin?Question 4: Why is the Great Wall of China a popular tourist destination?Section B: GrammarChoose the correct answer to complete each sentence.5. I ____ (am / is / are) going to the movies tonight.6. Mary _____ (has / have) already finished her homework.7. We _____ (are / is / am) studying for our exams.Section C: WritingWrite an essay (200-250 words) on the following topic: "The Importance of Learning a Second Language."Section D: Listening ComprehensionListen to the audio recordings and answer the questions.1. What is the speaker talking about?2. Where does the conversation take place?Section E: SpeakingPrepare a 1-minute speech on the topic "My Hobbies and Interests."Good luck on your exam!篇3Zhejiang University of Technology Comprehensive English Freshman ExamPart I Vocabulary and Structure (20 points)Directions: There are 40 incomplete sentences in this part. For each sentence, there are four choices marked A, B, C, and D. Choose the one that best completes the sentence.1. Many people agree _________ the saying, "Where there is a will, there is a way."A. toB. withC. inD. on2. I haven't heard _________ book since I was a schoolchild.A. the similarB. a similarC. similarD. similar a3. Listen! Can you hear someone _________ outside the door?A. knockingB. knockedC. knockD. to knock4. It was raining hard yesterday, and I _________ a taxi to the airport.A. having to takeB. had to takeC. have to takeD. must take5. I think we should take ________ of this opportunity to learn something new.A. advantageB. advantage withC. advantage ofD. advantage toPart II Reading Comprehension (40 points)Directions: There are 15 incomplete reading passages in this part. Each passage is followed by four questions or unfinished statements. For each of them, there are four choices marked A, B, C, and D. Choose the one that best completes the statement.Passage 1We all know that exercise is good for our bodies, but did you know it's also good for our brains? Researchers have found that regular physical activity can increase brain function and improve memory. In one study, older adults who walked for 40 minutes three times a week saw an improvement in their memory over the course of a year. This is because exercise helps to increase blood flow to the brain, which in turn helps to improve cognitive function.6. According to the passage, what can regular physical activity do?A. Decrease brain function.B. Decrease memory.C. Increase brain function.D. Increase memory.7. How often did the older adults walk in the study mentioned in the passage?A. Once a week.B. Twice a week.C. Three times a week.D. Five times a week.8. How long did the older adults walk in the study mentioned in the passage?A. 20 minutes.B. 30 minutes.C. 40 minutes.D. 50 minutes.9. How does exercise help improve cognitive function?A. By decreasing blood flow to the brain.B. By increasing blood flow to the brain.C. By increasing memory loss.D. By decreasing memory loss.Part III Cloze Test (10 points)Directions: There are 20 blanks in the following passage. For each blank, there is a choice of four words marked A, B, C, and D. Choose the one that best completes the passage.When it comes to climate change, we often hear about the impact on our environment and the ____10____ of global warming. But did you know that climate change can also have a significant impact on our health? According to the World Health Organization, rising temperatures and changing weather patterns can lead to an increase in the ____11____ of heat-related illnesses, such as heatstroke and dehydration. In addition, extreme weather events, such as hurricanes and floods, can____12____ to an increase in the spread of infectious diseases. It's clear that climate change is not only an environmental issue but also a ____13____ health issue.10. A. effectB. affectC. effectsD. affects11. A. incidentB. instanceC. incidenceD. incidents12. A. leadB. ledC. leadsD. leading13. A. seriousB. seriouslyC. seriousnessD. seriousPart IV Writing (30 points)Directions: Write an essay of about 200 words on the following topic:"The Importance of Learning English"In today's globalized world, English has become the lingua franca, spoken by people from different countries and cultures. Learning English is essential for communication in various fields, such as business, science, and technology. By learning English,one can access a wealth of information and opportunities that may not be available in their native language. Additionally, English is the language of the internet, making it easier to communicate and connect with people from around the world.Furthermore, learning English can open up doors to higher education and employment opportunities. Many universities and companies require a certain level of English proficiency for admission or employment. By acquiring English proficiency, individuals can expand their horizons and pursue their academic and career goals.In conclusion, learning English is crucial in today's interconnected world. It not only facilitates communication but also provides access to a wide range of opportunities. Therefore, it is important for individuals to invest time and effort in learning English to enhance their personal and professional growth.。

编译原理-期末复习

编译原理-期末复习编译原理⼀、单选题1、将编译程序分为若⼲个“遍”是为了()。

BA.提⾼程序的执⾏效率B.使程序的结构更加清晰C.利⽤有限的机器内存并提⾼机器的执⾏效率D.利⽤有限的机器内存但降低了机器的执⾏效率2、构造编译程序应掌握()。

DA.源程序B.⽬标语⾔C.编译⽅法D.以上三项都是3、变量应当()。

CA.持有左值B.持有右值C.既持有左值⼜持有右值D.既不持有左值也不持有右值4、编译程序绝⼤多数时间花在()上。

DA.出错处理B.词法分析C.⽬标代码⽣成D.管理表格5、()不可能是⽬标代码。

DA.汇编指令代码B.可重定位指令代码C.绝对指令代码D.中间代码6、编译程序是对()。

DA.汇编程序的翻译B.⾼级语⾔程序的解释执⾏C.机器语⾔的执⾏D.⾼级语⾔的翻译7、正规式M1和M2等价是指()。

CA.M1和M2的状态数相等B.M1和M2的有象弧条数相等C.M1和M2所识别的语⾔集相等D.M1和M2状态数和有象弧条数相等8、如果⽂法G是⽆⼆义的,则它的任何句⼦()。

AA.最左推导和最右推导对应的语法树必定相同。

B.最左推导和最右推导对应的语法树可能相同。

C.最左推导和最右推导必定相同。

D.可能存在两个不同的最左推导,但它们对应的语法树相同。

9、⽂法G:S→S+T|TT→T*P|PP→(S)|i句型P+T+i的短语有()BA.i,P+TB. P,P+T,i,P+T +iB.P+T + i D. P,P+T,i10、产⽣正规语⾔的⽂法为()。

DA.0型B.1型C.2型D.3型11、⽂法G:S→b|?|(T)T→T?S|S则FIRSTVT(T)=() CA.{b,?,(}B.{b,?,)}C.{b,?,(,?}D.{b,?,),?}12、给定⽂法:A→bA | cc,下⾯的符号串中,为该⽂法句⼦的是()。

A①cc ②bcbc ③bcbcc ④bccbcc ⑤bbbcc可选项有:A.①B.①③④⑤C.①④D.①④⑤13、采⽤⾃上⽽下分析,必须()。

编译原理期末复习题

编译原理期末复习题⼀、单项选择题1.构造编译程序应掌握。

Da. 源程序b. ⽬标语⾔c. 编译⽅法d. 以上三项都是 2.编译程序绝⼤多数时间花在上。

Da. 出错处理b. 词法分析c. ⽬标代码⽣成d. 表格管理 3.DFA M(见图1-1)接受的字集为。

Da. 以0开头的⼆进制数组成的集合b. 以0结尾的⼆进制数组成的集合c. 含奇数个0的⼆进制数组成的集合d. 含偶数个0的⼆进制数组成的集合4. -a-(b*c/(c-d)+(-b)*a)的逆波兰表⽰是。

(@代表后缀式中的求负运算符) Ca. abc*cd-b@a*+/-@b. a@bc*cd-b@a*+/-c. a@bc*cd-/b@a*+-d. a@bc*/cd-b@a*+- 5.在规范归约中,⽤来刻画可归约串。

Ba. 直接短语b. 句柄c. 最左素短语d. 素短语6.若B 为⾮终结符,则A →α·B β为项⽬。

Da. 归约b. 移进c. 接受d. 待约 7.中间代码⽣成时所依据的是。

Ca. 语法规则b. 词法规则c. 语义规则d. 等价变换规则8.有⽂法G 及其语法制导翻译如下所⽰(语义规则中的*和+分别是常规意义下的算术运算符):E →E (1)∧ T {E.val = E (1).val * T.val} E →T {E.val = T.val}T →T (1)# n {T.val = T (1).val + n.val } T → n {T.val = n.val}则分析句⼦1 ∧ 2 ∧ 3 # 4其值为。

Ca. 10b. 34c. 14d.54 9.如果⽂法G 是⽆⼆义的,则它的任何句⼦α。

A1图1-1a. 最左推导和最右推导对应的语法树必定相同b. 最左推导和最右推导对应的语法树可能不同c. 最左推导和最右推导必定相同d. 可能存在两个不同的最左推导,但它们对应的语法树相同10.下列动作中,不是⾃下⽽上分析动作的是:。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

浙江工业大学期终考试命题稿
课程名称 编译原理 使用班级
网络工程、计自
计算机14级

教师份数 2 学生份数 130
命题人 夏列钢 审核人
命题总页数 页 每份试卷需用白纸 1 大张

命题注意事项:
一、命题稿请用A4纸电脑打印,或用教务处印刷的命题纸,并用黑
墨水书写,保持字迹清晰,页码完整。
二、两份试题必须同等要求,卷面上不要注明A、B字样,由教务处
抽定A、B卷。
三、命题稿必须经学院审核,并在考试前两周交教务处。
浙江工业大学学年
第 二 学期试卷

课程____________编译原理_____________班级____________________________
姓名__________________学号_______ _____________教师姓名______________
题序 一 二 三 四 五 六 七 八 总评
计分
命题:
1. 判断下述语言是正规语言还是上下文无关语言,分别用正规式或上下文无关文法描述.
(15分)
1) {anbm| n,m≥1}
2) {anbn| n≥1}
3) { anbm| n≥m≥1}

2.考虑上下文无关文法:
S→SS*|SS+|a
1) 以最右推导生成串aa+a*,并构造推导树;
2) 该文法是否存在二义性. (10分)

第 页
浙 江 工 业 大 学 考 试 命 题 纸
3.已知如下两个正规式,试通过自动机判断它们是否等价. (15分)
(1)((a|b)*|aa*)*b
(2)(a|b)*b

4.对文法G[A]: A→aABe|a B→Bb|d, (14分)
(1) 消除左递归并提取左公共因子; (2分)
(2) 判断新文法是否为LL(1)文法, 如果是列出其预测分析表. (12分)

5.已知文法G=({A,B,D},{a,b },P,S),其中P为:
A→BaBb|DbDa
B→ε
D→ε
(1) 判断G是LR(0)、SLR(1)还是LR(1),请给出原因; (10分)
(2) 构造与上述判断文法相应的分析表; (5分)
(3) 对输入串 ab#给出分析过程. (3分)
6. 根据如下语法制导定义,判断其是S属性文法还是L属性文法,并对输入表达式(4*7+1)
*2建立一棵带注释的分析树。 (14分)
7. 下面的程序执行时输出的分别是什么?若

1) 参数传递办法为“传值”;
2) 参数传递办法为“传地址”. (6分)
program main( input,output);
procedure P(x,y,z);
begin
y:=y+1;
z:=z+x;
end; /*P*/
begin
a:=2;b:=3;P(a+b,a,a);
print a
end. /*main*/

8. 对如下程序流图(8分)
(1) 求出流图中各结点 n 的必经结点集 D(n); (5分)
(2) 求出流图中的回边; (1分)
(3) 求出流图中的循环. (2分)

B1

B2
B3
B4
B5
B6
B7
B8

第 页

相关文档
最新文档