chapter 6.1
- 格式:pdf
- 大小:912.24 KB
- 文档页数:80
Chapter 6: Nutrition6.1 Why Your Body Needs Food∙Food contains many substances that provide one with energy as well as the materials needed for their body to grow and repair itselfYour Body – What is it Made of?-∙Made of matter∙The human body is mostly hydrogen, oxygen, carbon and nitrogen (96% of one’s total mass)∙Phosphorus, iron, iodine, etc. are present in small amounts but still very important; without them the body can’t function∙Most elements aren’t present in pure form but joined to form compound s Nutrition-∙Nutrients are material that can be taken into cells and are useful to the body ∙Nutrition is the study of nutrients and their effect on one’s health∙Good nutrition is especially important for teenager b/c of the changes taking place in their bodies; a time of rapid growth and development6.2 Nutrients for Energy∙Bodies need ~ 50 different nutrients∙Most can be classified into one of six groups: carbohydrates, fats, proteins, minerals, vitamins and water∙Nutrients in these groups supply body cells with energy needed to function∙Energy cells obtain from food is called food energy∙B/c energy needed by one’s body is so great food energy is measured in kilojoules Carbohydrates-∙Major source of energy the body needs is from carbohydrates (~ 55%)∙Contain carbon, hydrogen and oxygen atoms arranged in certain ways∙Simple carbohydrates are made up of small, simple molecules, also called sugars(names end in “ose”)∙Glucose in the major source of energy for all body cells∙Complex carbohydrates are larger molecules and are made of many sugar molecules joined together∙ A complex carbohydrate often eaten is starch and glycogen∙Can’t supply energy to body cells immediately and need to be broken into the small sugar molecules they are made of (this process is digestion) ∙Some leftover glucose molecules are stored for future use as glycogen molecules (usually in muscles and the liver)Fats-∙Another source of energy comes from fats∙Fats come from meats, margarine, eggs, dairy products, nuts and oils∙Fat molecules are mad up of carbon, hydrogen and oxygen atoms but fat molecules contain many more hydrogen atoms and fewer oxygen atoms ∙Eat fat molecule contain smaller molecules called fatty acids∙The body stores much of its energy in body fat∙Saturated fats contain as many hydrogen atoms as possible and are found in animal products (ie. meat, milk, cheese, eggs, butter)∙Unsaturated fats have spaces in which more hydrogen atoms can be added and usually come from plant products (ie. corn, peanut oil)∙No more than 30% of food energy should be from fats (no more than 10% saturated fats)∙High amounts of saturated fats increase the amount of cholesterol, a fat-like compound found in animal products, in the blood6.3 Proteins: Nutrients for Growth and Repair∙Proteins form an important nutrient group∙Main function is to help body cells work properly and help in building and repairing these cells∙The building blocks of proteins are amino acids (composed of nitrogen, hydrogen, oxygen and carbon atoms)∙ A molecule of protein is composed of many amino acid molecules joined together ∙One required 20 amino acids to make all proteins needed∙The body can make 12 from atoms supplied by other nutrients eaten, these are the non-essential amino acids since one doesn’t have to eat foods containing t hem ∙The body can’t make 8 amino acids, which are the essential amino acids since one needs to eat foods containing them∙Some proteins are called complete proteins because they contain all eight essential amino acids in adequate amounts∙Some proteins that are missing one or more of the eight essential amino acids are incomplete proteinsHow Your Body Uses Proteins-∙Proteins are needed in every cell∙Some proteins form bones, hair, skin and nails∙Sense organs, nerves and the brain wouldn’t work without other p roteins∙Most important proteins are enzymes, proteins that speed up the rates of chemical reactions within the body∙For energy the body first uses glucose or fatty acids and if none are available then amino acids are used∙The body can’t store amino acids s o if too many proteins are eaten they are converted into fat (change can’t be reversed)∙If not enough protein is eaten the body breaks down body parts to obtain amino acids needed6.4 Minerals and Vitamins∙Two types of nutrients needed in small quantities are minerals and vitaminsMinerals-∙Minerals are elements the body needs for important jobs∙Large amounts of calcium, chlorine, magnesium, phosphorus, potassium, sodium and sulphur are needed∙Small quantities of iron, copper, iodine and zinc are needCalcium: The Most Important Mineral-∙About 2% of a body’s total mass is calcium, in bones and teeth∙Main source of calcium is milk and dairy products∙Calcium is not easily absorbed but when vitamin D is present it is absorbed more easily∙Calcium is mainly used for growth and repair of bones; help nerve impulses travel; help blood clot; needed for muscles to work properlyYour Need for Iron-∙Best source of iron is meet∙Iron is needed in blood cells to pick up oxygen and carry it throughout the body, and deliver it to other cells∙Iron in the muscle cells help them store oxygen∙P eople who don’t eat enough iron have iron-deficiency anemia and feel weak and tired∙Too much iron however is harmfulVitamins-∙Vitamins are nutrients that act as “assistants” to enzymes∙Certain vitamins are needed for the body to use other nutrients (ie. Vitamin C help body cells absorb iron)Classifying Vitamins-∙Divided into two groups depending on if they dissolve in water or fat∙Vitamin C & B are water-soluble; the rest are fat-soluble (can’t be absorbed by the body unless they are eaten with fats)∙Too many fat-soluble can cause serious problems∙Extra amount of vitamins B & C dissolve in body fluids and leave in urine 6.5 Water: The Most Important Nutrient∙Water makes up 55-65% of the human body∙Water is the basic unit of all living things, carries nutrients needed, carries waste products away, and cells need water for the chemical reactions that break down large nutrient molecules∙When one sweats the water on the skin cools the body∙Water lubricates joints and food6.6 Fiber: Not a Nutrient, But Still Important∙Dietary fiber is part of many foods but is not a nutrient b/c it’s not digested∙Best sources are products made with whole-grain flours, fruits and vegetables ∙Is made up of complex carbohydrate molecules but can’t be broken down∙Some types of fiber hold on to water so that feces can move more easily through 6.7 Food Processing∙Food processing refers to anything that is don’t to plant or animal foods before they are eaten (ie. cooking, packaging, freezing, drying)∙Reason from processing food is to preserve it, keep it from going badPreserving Food-∙Often micro-organisms cause food to spoil∙Illness caused by micro-organisms in food often cause food poisoning, produces headaches, nausea, vomiting, diarrhea and occasionally death ∙People process foods by canning, freezing, drying, pickling or smoking it Food Additives-∙ A food additive is a substance added to food during processing∙Substances, called preservatives, help keep food from spoiling∙Additives may be nutrients (ie. vitamins and minerals)∙Foods are fortified when nutrients are added to it that are normally not present in the food∙Foods are enriched when nutrients normally present in foods are increased by food processing∙Nitrites are added to bacon, ham, etc. as preservatives but are believed to cause cancerAdvantages and Disadvantages of Food Processing-∙Advantages include:1.Allowing foods to be stored longer2.Adding convenience3.Adding nutrients to the food∙Disadvantages include:1.Costing more2.Removing vitamins or minerals3.Adding substances to food that may be harmful to peopleFood Labeling-∙In Canada, every package of food must have a label listing all ingredients∙Ingredients are listed in order from the ingredient making up the largest part and ending with the one that makes up the smallest part∙Labels on food also tell the amounts of nutrients in a serving∙Some labels provide a “best before” date6.8 Nutrition and Diet∙ A diet consists of all foods that one regularly eats and drinks∙Food choices have a very important effect on one’s healthA Balanced Diet-∙Health and Welfare Canada developed Canada’s Food Guide to Healthy Eating∙All foods one should eat are divided into 4 groups: grain products, vegetables and fruits, milk products and meat/meat alternatives∙One should include a variety of foods from eat group in their diet Nutrition and World Health-∙~ 10 000 years ago people grew crops and raised domestic animals∙Better methods of farming, fishing and food processing allowed food production to keep up with the growing human population∙Pollution, soil erosion, natural disasters, over fishing, overgrazing and other factors resulted in poorer quality and a lower quantity of many types of foods ∙Over nourishment, eating more food than the body needs, results in obesity (problem in Canada)∙In other countries many are undernourished and starve to die∙ Both forms of malnutrition(“mal” means “bad”) are caused by a lack of one or more important nutrients in a person’s diet∙One of the biggest challenges is how to manage the world’s res ources so all people can obtain enough food。
Economics of Money, Banking, and Financial Markets, 11e, Global Edition (Mishkin) Chapter 6 The Risk and Term Structure of Interest Rates6.1 Risk Structure of Interest Rates1) The risk structure of interest rates isA) the structure of how interest rates move over time.B) the relationship among interest rates of different bonds with the same maturity.C) the relationship among the term to maturity of different bonds.D) the relationship among interest rates on bonds with different maturities.Answer: BAACSB: Reflective Thinking2) The risk that interest payments will not be made, or that the face value of a bond is not repaid when a bond matures isA) interest rate risk.B) inflation risk.C) liquidity risk.D) default risk.Answer: DAACSB: Application of Knowledge3) Bonds with no default risk are calledA) flower bonds.B) no-risk bonds.C) default-free bonds.D) zero-risk bonds.Answer: CAACSB: Application of Knowledge4) Which of the following bonds are considered to be default-risk free?A) municipal bondsB) investment-grade bondsC) U.S. Treasury bondsD) junk bondsAnswer: CAACSB: Analytical Thinking5) U.S. government bonds have no default risk becauseA) they are issued in strictly limited quantities.B) the federal government can increase taxes or print money to pay its obligations.C) they are backed with gold reserves.D) they can be exchanged for silver at any time.Answer: BAACSB: Reflective Thinking6) The spread between the interest rates on bonds with default risk and default-free bonds is called theA) risk premium.B) junk margin.C) bond margin.D) default premium.Answer: AAACSB: Application of Knowledge7) If the probability of a bond default increases because corporations begin to suffer large losses, then the default risk on corporate bonds will ________ and the expected return on these bonds will ________, everything else held constant.A) decrease; increaseB) decrease; decreaseC) increase; increaseD) increase; decreaseAnswer: DAACSB: Reflective Thinking8) A bond with default risk will always have a ________ risk premium and an increase in its default risk will ________ the risk premium.A) positive; raiseB) positive; lowerC) negative; raiseD) negative; lowerAnswer: AAACSB: Reflective Thinking9) If a corporation begins to suffer large losses, then the default risk on the corporate bond willA) increase and the bond's return will become more uncertain, meaning the expected return on the corporate bond will fall.B) increase and the bond's return will become less uncertain, meaning the expected return on the corporate bond will fall.C) decrease and the bond's return will become less uncertain, meaning the expected return on the corporate bond will fall.D) decrease and the bond's return will become less uncertain, meaning the expected return on the corporate bond will rise.Answer: AAACSB: Reflective Thinking10) If the possibility of a default increases because corporations begin to suffer losses, then the default risk on corporate bonds will ________, and the bonds' returns will become ________ uncertain, meaning that the expected return on these bonds will decrease, everything else held constant.A) increase; lessB) increase; moreC) decrease; lessD) decrease; moreAnswer: BAACSB: Reflective Thinking11) Other things being equal, an increase in the default risk of corporate bonds shifts the demand curve for corporate bonds to the ________ and the demand curve for Treasury bonds to the________.A) right; rightB) right; leftC) left; rightD) left; leftAnswer: CAACSB: Reflective Thinking12) Other things being equal, a decrease in the default risk of corporate bonds shifts the demand curve for corporate bonds to the ________ and the demand curve for Treasury bonds to the________.A) right; rightB) right; leftC) left; rightD) left; leftAnswer: BAACSB: Reflective Thinking13) A(n) ________ in the riskiness of corporate bonds will ________ the price of corporate bonds and ________ the yield on corporate bonds, all else equal.A) increase; increase; increaseB) increase; decrease; increaseC) decrease; increase; increaseD) decrease; decrease;decreaseAnswer: BAACSB: Reflective Thinking14) An increase in the riskiness of corporate bonds will ________ the price of corporate bonds and ________ the price of Treasury bonds, everything else held constant.A) increase; increaseB) reduce; reduceC) reduce; increaseD) increase; reduceAnswer: CAACSB: Reflective Thinking15) A decrease in the riskiness of corporate bonds will ________ the price of corporate bonds and ________ the price of Treasury bonds, everything else held constant.A) increase; increaseB) reduce; reduceC) reduce; increaseD) increase; reduceAnswer: DAACSB: Reflective Thinking16) An increase in the riskiness of corporate bonds will ________ the yield on corporate bonds and ________ the yield on Treasury securities, everything else held constant.A) increase; increaseB) reduce; reduceC) increase; reduceD) reduce; increaseAnswer: CAACSB: Reflective Thinking17) A decrease in the riskiness of corporate bonds will ________ the yield on corporate bonds and ________ the yield on Treasury securities, everything else held constant.A) increase; increaseB) decrease; decreaseC) increase; decreaseD) decrease; increaseAnswer: DAACSB: Reflective Thinking18) An increase in default risk on corporate bonds ________ the demand for these bonds, but ________ the demand for default-free bonds, everything else held constant.A) increases; lowersB) lowers; increasesC) does not change; greatly increasesD) moderately lowers; does not changeAnswer: BAACSB: Reflective Thinking19) A decrease in default risk on corporate bonds ________ the demand for these bonds, and________ the demand for default-free bonds, everything else held constant.A) increases; lowersB) lowers; increasesC) does not change; greatly increasesD) moderately lowers; does not changeAnswer: AAACSB: Reflective Thinking20) As default risk increases, the expected return on corporate bonds ________, and the return becomes ________ uncertain, everything else held constant.A) increases; lessB) increases; moreC) decreases; lessD) decreases; moreAnswer: DAACSB: Reflective Thinking21) As default risk decreases, the expected return on corporate bonds ________, and the return becomes ________ uncertain, everything else held constant.A) increases; lessB) increases; moreC) decreases; lessD) decreases; moreAnswer: AAACSB: Reflective Thinking22) As their relative riskiness ________, the expected return on corporate bonds ________ relative to the expected return on default-free bonds, everything else held constant.A) increases; increasesB) increases; decreasesC) decreases; decreasesD) decreases; does not changeAnswer: BAACSB: Reflective Thinking23) Which of the following statements are TRUE?A) A decrease in default risk on corporate bonds lowers the demand for these bonds, but increases the demand for default-free bonds.B) The expected return on corporate bonds decreases as default risk increases.C) A corporate bond's return becomes less uncertain as default risk increases.D) As their relative riskiness increases, the expected return on corporate bonds increases relative to the expected return on default-free bonds.Answer: BAACSB: Reflective Thinking24) Everything else held constant, if the federal government were to guarantee today that it will pay creditors if a corporation goes bankrupt in the future, the interest rate on corporate bonds will ________ and the interest rate on Treasury securities will ________.A) increase; increaseB) increase; decreaseC) decrease; increaseD) decrease; decreaseAnswer: CAACSB: Reflective Thinking25) Bonds with relatively high risk of default are calledA) Brady bonds.B) junk bonds.C) zero coupon bonds.D) investment grade bonds.Answer: BAACSB: Analytical Thinking26) Junk bonds, bonds with a low bond rating, are also known asA) high-yield bonds.B) investment grade bonds.C) high quality bonds.D) zero-coupon bonds.Answer: AAACSB: Application of Knowledge27) Bonds with relatively low risk of default are called ________ securities and have a rating of Baa (or BBB) and above; bonds with ratings below Baa (or BBB) have a higher default risk and are called ________.A) investment grade; lower gradeB) investment grade; junk bondsC) high quality; lower gradeD) high quality; junk bondsAnswer: BAACSB: Analytical Thinking28) Which of the following bonds would have the highest default risk?A) municipal bondsB) investment-grade bondsC) U.S. Treasury bondsD) junk bondsAnswer: DAACSB: Reflective Thinking29) Which of the following long-term bonds has the highest interest rate?A) corporate Baa bondsB) U.S. Treasury bondsC) corporate Aaa bondsD) municipal bondsAnswer: AAACSB: Reflective Thinking30) Which of the following securities has the lowest interest rate?A) junk bondsB) U.S. Treasury bondsC) investment-grade bondsD) corporate Baa bondsAnswer: BAACSB: Reflective Thinking31) The spread between interest rates on low quality corporate bonds and U.S. government bondsA) widened significantly during the Great Depression.B) narrowed significantly during the Great Depression.C) narrowed moderately during the Great Depression.D) did not change during the Great Depression.Answer: AAACSB: Reflective Thinking32) During the Great Depression years 1930-1933 there was a very high rate of business failures and defaults, we would expect the risk premium for ________ bonds to be very high.A) U.S. TreasuryB) corporate AaaC) municipalD) corporate BaaAnswer: DAACSB: Reflective Thinking33) Risk premiums on corporate bonds tend to ________ during business cycle expansions and ________ during recessions, everything else held constant.A) increase; increaseB) increase; decreaseC) decrease; increaseD) decrease; decreaseAnswer: CAACSB: Reflective Thinking34) The collapse of the subprime mortgage marketA) did not affect the corporate bond market.B) increased the perceived riskiness of Treasury securities.C) reduced the Baa-Aaa spread.D) increased the Baa-Aaa spread.Answer: DAACSB: Reflective Thinking35) The collapse of the subprime mortgage market increased the spread between Baa and default-free U.S. Treasury bonds. This is due toA) a reduction in risk.B) a reduction in maturity.C) a flight to quality.D) a flight to liquidity.Answer: CAACSB: Analytical Thinking36) During a "flight to quality"A) the spread between Treasury bonds and Baa bonds increases.B) the spread between Treasury bonds and Baa bonds decreases.C) the spread between Treasury bonds and Baa bonds is not affected.D) the change in the spread between Treasury bonds and Baa bonds cannot be predicted. Answer: AAACSB: Reflective Thinking37) If you have a very low tolerance for risk, which of the following bonds would you be least likely to hold in your portfolio?A) a U.S. Treasury bondB) a municipal bondC) a corporate bond with a rating of AaaD) a corporate bond with a rating of BaaAnswer: DAACSB: Reflective Thinking38) Which of the following statements is TRUE?A) A liquid asset is one that can be quickly and cheaply converted into cash.B) The demand for a bond declines when it becomes less liquid, decreasing the interest rate spread between it and relatively more liquid bonds.C) The differences in bond interest rates reflect differences in default risk only.D) The corporate bond market is the most liquid bond market.Answer: AAACSB: Reflective Thinking39) Corporate bonds are not as liquid as government bonds becauseA) fewer corporate bonds for any one corporation are traded, making them more costly to sell.B) the corporate bond rating must be calculated each time they are traded.C) corporate bonds are not callable.D) corporate bonds cannot be resold.Answer: AAACSB: Reflective Thinking40) When the Treasury bond market becomes more liquid, other things equal, the demand curve for corporate bonds shifts to the ________ and the demand curve for Treasury bonds shifts to the ________.A) right; rightB) right; leftC) left; rightD) left; leftAnswer: CAACSB: Reflective Thinking41) When the Treasury bond market becomes less liquid, other things equal, the demand curve for corporate bonds shifts to the ________ and the demand curve for Treasury bonds shifts to the ________.A) right; rightB) right; leftC) left; rightD) left; leftAnswer: BAACSB: Reflective Thinking42) A decrease in the liquidity of corporate bonds, other things being equal, shifts the demand curve for corporate bonds to the ________ and the demand curve for Treasury bonds shifts to the ________.A) right; rightB) right; leftC) left; leftD) left; rightAnswer: DAACSB: Reflective Thinking43) An increase in the liquidity of corporate bonds, other things being equal, shifts the demand curve for corporate bonds to the ________ and the demand curve for Treasury bonds shifts to the ________.A) right; rightB) right; leftC) left; leftD) left; rightAnswer: BAACSB: Reflective Thinking44) A(n) ________ in the liquidity of corporate bonds will ________ the price of corporate。
2012第六章输入输出接口技术北京理工大学2012 BIT 第一节接口技术的基本概念一、接口的概念和功能二、接口电路的典型结构三、接口功能第二节I/O端口的编址和译码一、I/O端口的编址方式二、输入/输出指令三、I/O端口的译码第三节CPU与外设间的数据传送方式一、无条件传送方式二、条件传送方式三、中断传送方式四、DMA传送方式2012 BIT 第一节接口技术的基本概念一、接口的概念和功能1 接口:指CPU与存储器和外设之间通过总线进行连接的电路部分,是CPU与外界进行信息交换的中转站。
为什么要在CPU与外设之间设置接口电路?其一,CPU与外设两者的信号线不兼容,在信号线功能定义、逻辑定义和时序关系上都不一致;其二,两者的工作速度不兼容,CPU速度高,外设速度低; 其三,若不通过接口,而由CPU直接对外设的操作实施控制,就会使CPU处于穷于应付与外设打交道之中,大大降低CPU的效率;其四,若外部设备直接由CPU控制,也会使外设的硬件结构依赖于CPU,对外设本身的发展不利。
因此,有必要设置接口电路,以便协调CPU与外设两者的工作,提高CPU的效率,并有利于外设按自身的规律发展。
C P U接口作用外设模/数转换(A/D)数/模转换(D/A)模拟量信息类型数字量三态缓冲、锁存数字量工作速度快解决传送方式慢串/并转换并/串转换串行通信方式并行三态缓冲、锁存并行2 接口技术:是研究CPU如何与外部世界进行最佳耦合与匹配,实现双方高效、可靠地交换信息的一门技术,是软件、硬件结合的体现,是微机应用的关键。
微机接口技术综合性很强,所涉及的知识面很宽,包括微机原理、汇编语言(或高级语言)程序设计、电子技术、自控原理以及通信技术等多门课程的基础理论和专业知识。
3.接口技术在微机应用中的作用微机应用系统的研究和微机化产品的开发,从硬件角度来讲,就是接口电路的研究和开发,接口技术已成为直接影响微机系统的功能和微机推广应用的关键。
微机的应用是随着外部设备的不断更新和接口技术的发展而深入到各个领域的。
1从编程角度看,接口内部主要包括一个或多个CPU 可以进行读/写操作的寄存器,又称为I/O 端口。
2各I/O 端口由端口地址区分。
I/O 端口1I/O 端口2I/O 端口3地址译码数据缓冲控制电路外设ABDBCBC P U3按存放信息的不同,I/O 端口可分为三种类型数据端口:用于存放CPU 与外设间传送的数据信息状态端口:用于暂存外设的状态信息控制端口:用于存放CPU 对外设或接口的控制信息,控制外设或接口的工作方式。
1001 0101 (状态端口)0110 1010(数据端口)1100 0110(控制端口)地址译码数据缓冲控制电路外设ABDBCBC P U4CPU 对外设输入/输出的控制,是通过对接口电路中各I/O 端口的读/写操作完成。
I/O 端口1I/O 端口2I/O 端口3地址译码数据缓冲控制电路外设ABDBCBC P U三、接口功能1. 执行CPU命令的功能CPU对被控对象外部设备的控制命令是以命令代码的形式先发送到接口中的命令寄存器,称之为“命令口”。
再由接口电路对命令代码进行识别和分析,分解成若干个控制信号,传送到I\O设备,使其产生相应的具体操作。
可见,CPU并不是直接把命令送到被控对象,而是通过接口电路来进行控制的。
2. 返回外设状态的功能(联络)接口电路在执行CPU命令之前、执行命令过程中和执行命令之后,外部设备和接口电路都会有一些情况发生,这些"情况"就是所谓"状态",包括正常工作状态和故障状态。
如"忙"、"闲"、"准备就绪"、"未准备就绪"、"满"、"空",以及"溢出错""格式错"、"校验错"等状态。
接口中一般都设置状态寄存器,称之为"状态口"。
这些状态信号以状态代码形式存放在接口电路的状态寄存器中,以便向CPU报告。
CPU从"状态口"读取这些状态信息,就可以"知道"正在发生或已发生了哪些情况,以共CPU作出判断和处理。
3. 数据缓冲功能为了解决主机高速与外设低速的矛盾,避免因速度不一致而丢失数据,接口中一般都设置数据缓冲存储器(简称数据缓存器)。
称之为“数据口”。
数据缓存器又分为输入和输出缓存器两种,前者暂存外设送来的数据,以待CPU将它取走;后者暂存CPU送往外设的数据。
有了数据缓存器,就可以使高速工作的CPU与慢速工作的外设协调合作。
由于数据缓存器直接连在系统数据总线上,因此它应具有三态特性。
4. 信号转换功能由于外设所需的控制信号和它所能提供的状态信号往往同微机的总线的信号不兼容。
不兼容性表现在两者的信号功能定义、逻辑关系、电平高低以及工作时序的不一致。
因此,信号转换(包括CPU的信号与外设的信号的逻辑关系上、时序配合上以及电平匹配上的转换),就成为接口设计中的一个重要任务。
5. 设备选择功能在微机系统中一般有多种外设,在同一种外设中也可以有多台,而一个CPU在同一时间里只能与一台外设交换信息,这就要在接口中设置I\O端口地址译码电路对外设进行寻址。
CPU将I\O设备的端口地址代码送到接口中的地址译码电路,并经译码电路,把地址代码翻译成I\O设备的选择信号。
一般是把高位地址用于接口芯片选择,低位地址进行芯片内部寄存器的选择,以选定需要与自己交换信息的设备端口,只有被选中的设备才能与CPU进行数据交换或通信。
没有选中的设备,就不能与CPU交换数据。
6. 数据宽度与数据格式转换的功能CPU所处理的是并行数据(8位、16位或32位),而有的外设(如串行通信设备)只能处理串行数据,在这种情况下,接口就应具有数据"并→串"和"串→并"的转换能力。
为此,在接口中设置移位存储器。
CPU 与有些外设交换数据时,要求按一定的数据格式传送,如串行通信中的起止式异步通信数据格式及面向字符的同步通信数据格式。
此时,需要在CPU与通信设备之间进行数据格式转换。
7.产生中断请求及DMA请求解决实时性和高速传输数据的问题。
接口与系统的连接2012 BIT 第二节I/O端口的编址和译码一、I/O端口的编址方式1.存储器映射(存储器与I/O端口统一编址)存储器映射的主要优点是:由于访问存储器的指令类型多,功能齐全,也方便了访问外设端口的操作,不仅对端口进行数据传送,还可以对端口内容进行算术逻辑运算、移位等,同时也为端口提供了较大的编址空间。
内存空间I/O空间2012 BIT2.I/O 独立编址方式这种方式的端口地址采用单独编址,构成一个I/O 空间,微处理器设置了专用的输入输出指令来访问端口,这种方式也常称为数据通道式的输入输出。
对于386 ,IO 空间64kB ,00F8H ——00FFH 保留。
I/O 空间内存空间2012 BIT I/O 独立编址方式(端口编址方式)Port 65535Port 255Port 3Port 2Port 1 Port 0Port 0(16位)Port 1(16位)Port 0 (32位)PC系列机采用I/O端口独立编址方式2012 BIT 端口地址是一种重要资源2012 BIT输入/输出指令实现I/O 端口与CPU 之间的数据传送I/O 端口1I/O 端口2I/O 端口3地址译码数据缓冲控制电路外设ABDBCBC P U1.输入指令IN2.输出指令OUT二、输入/输出指令2012 BIT可寻址216= 64 K 个I/O 端口I/O 端口范围0000 ~ FFFFH I/O 端口的地址由:一个8位二进制数直接寻址或DX 寄存器间接寻址CPU 采用I/O 端口与存储器分别独立编址I/O 空间内存空间2012 BIT 1. 输入指令IN格式执行操作IN AL, port(AL) ← (port端口)IN AX, port(AL) ← (port端口)(AH) ← (port+1端口)IN AL, DX(AL) ← ((DX)端口)IN AX, DX(AL) ← ((DX)端口)(AH) ← ((DX)+1端口) port 为数字形式的端口地址, 大小为0~255 或0~FFH例(1)IN AL,28H若(28H端口) = 1010 1111B执行后(AL) = (28H端口)= 0AFH(2)IN AX,28H若(28H端口)= 1010 1111B(29H端口)= 0101 0000B执行后(AL) = (28H端口)= 0AFH(AH) = (29H端口)= 50H(3)MOV DX,300HIN AL,DX若(300H端口)= 69H执行后(AL) = (300H端口)= 69H2. 输出指令OUTport 为数字形式的端口地址, 大小为0~255 或0~FFH格式执行操作OUT port, AL (port 端口) ←(AL)OUT port, AX (port 端口) ←(AL)(port+1端口) ←(AH)OUT DX, AL ((DX)端口) ←(AL)OUT DX, AX((DX)端口) ← (AL)((DX)+1端口) ←(AH)例(1)OUT 21H, AL若(AL)= 1100 1100B执行后(21H端口)= 0CCH(2)MOV DX ,21BHOUT DX,AL若(AL)= 1010 0110B执行后(21BH端口)= (AL) = 0A6H输入/输出指令(IN、OUT)特点:(1) 累加器AL、AX的专用指令对输入指令IN ,目的操作数只能为AL, 或AXIN AL, 21HIN AX, DXIN BX, 21H对输出指令OUT ,源操作数只能为AL, 或AXOUT 20H, ALOUT DX, AXOUT DX, CX2012 BIT(2)端口地址可由直接方式或间接方式给出例OUT 219H , AL ×MOV DX , 219H OUT DX , AL例IN AL, 218H×MOV DX , 218H IN AL, DX2当端口号>FFH ,即>255时,需把端口号放在DX 寄存器中,DX 是一个16位寄存器,范围在0~FFFFh 之间。
1当端口号在0~FFH ,即0~255时,可在指令中直接指定端口号例IN AL, 21HOUT 20H , AL2012 BIT当端口号在0~FFH,即0~255时,可在指令中直接指定端口号,称长格式指令当端口号>FFH,即>255时,需把端口号放在DX寄存器中,称短格式指令原因是使用直接端口方式的指令机器码相对长例指令机器码IN AL, 21H E421 ;两个字节OUT 20H, AL E620IN AL, DX EC ;一个字节OUT DX, AL EE2012 BIT三、I/O端口的译码1.译码电路的作用2.译码电路的构成3.设计译码电路的方法4.片内译码和片选译码2012 BIT1、译码电路的作用将CPU 执行IN/OUT 指令发出的地址信号,“翻译”成欲操作端口的选通信号,解决存储器、I/O 设备与CPU 连接时地址总线失配问题。