1 EE331 Assignment #1 September 12, 2008 Due Friday, September 19, 2008 – 3 00PM 1 a) What is a microprocessor? (1) A single integrated circuit that acts as a central processing unit The “brain” of a[.]
EE331 Assignment #1 September 12, 2008 Due: Friday, September 19, 2008 – 3:00PM a) What is a microprocessor? (1) A single integrated circuit that acts as a central processing unit The “brain” of a computer system b) What is the difference between a microprocessor, a microcomputer and a microcontroller? (2) A microprocessor doesn’t have any I/O capability or memory A microcomputer contains a microprocessor, memory, I/O circuitry and possibly other devices A microcontroller is a microprocessor, memory and I/O all on a single chip c) What are the six basic components of a microprocessor based system? (1) The control unit, the register array, the arithmetic logic unit (ALU), memory, the input unit and the output unit Perform the following conversions It is okay to check your answers with a calculator, but you will get no marks if no work is shown a) (1111010111)2 to decimal (1) x 20 + 1x 21 + x 22 + x 23 + x 24 + x 25 + x 26 + x 27 + x 28 + x 29 = + + + 16 + 64 + 128 + 256 + 512 = (983)10 b) (2313.03125)10 to binary (1) Integer Part: Remainder 2313 /2 -> LSB 1156 /2 -> 578 /2 -> 289 /2 -> 144 /2 -> 72 /2 -> 36 /2 -> 18 /2 -> /2 -> /2 -> /2 -> /2 -> 0 Fractional Part: Whole Number 0.03125 x -> MSB 0.0625 x -> 0.125 x -> 0.25 x -> 0.5 x -> LSB ans: (100100001001.00001)2 MSB c) (7777)8 to decimal (1) x 80 + x 81 + x 82 + x 83 = + 56 + 448 + 3584 = (4095)10 1/8 d) (65537)10 to octal (1) Remainder 65537 /8 -> LSB 8192 /8 -> 1024 /8 -> 128 /8 -> 16 /8 -> /8 -> MSB ans: (200001)8 e) (37FD)16 to decimal and to binary (2) 13 x 160 + 15 x 161 + x 162 + x 163 = 13 + 240 + 1792 + 12288 = (14333)10 For binary, convert each digit of hex into four bits: -> 0011 -> 0111 F -> 1111 D -> 1101 ans: (0011011111111101)2 f) (4095)10 to hex (1) Remainder 4095 /16 -> F LSB 255 /16 -> F 15 / 16 -> F MSB ans: (FFF)16 Or, since we know from c) that (4095)10 = (7777)8, we can convert (7777)8 into binary by turning each into a group of three ones and then regroup them in fours to convert to hex: (7777)8 = (111 111 111 111)2 = (1111 1111 1111)2 = (FFF)16 g) (110101110010)2 to hex and octal (2) For hex, group into fours: (1101 0111 0010)2 ( D )16 For octal, group into threes: (110 101 110 010)2 ( 6 )8 Perform the following calculations Again, show your work and give all answers in hex a) (10101)2 + (11110)2 (1) 10101 + 11110 110011 -> (33)16 2/8 b) (1111.01)2 X (1001.11)2 (1) 1111.01 X 1001.11 111101 1111010 11110100 +11110100000 10010100.1011 -> (94.B)16 c) (00110111)2 – (01001001)2 using 2’s complement (1) 01001001: 1’s complement: 10110110 Add 1: + 10110111 00110111 + 10110111 11101110 -> (EE)16 Check: 2’s complement of 11101110 is 00010010 -> (18)10 So: (55)10-(73)10 = (-18)10 d) (76)8 – (57)8 (1) 614 -57 -> (0F)16 e) (FEED)16 – (45C3)16 using 2’s complement (1) (45C3)16 -> 0100 0101 1100 0011 1’s comp 1011 1010 0011 1100 Add 1: + 2’s comp 1011 1010 0011 1101 (FEED)16 -> 1111 1110 1110 1101 + 1011 1010 0011 1101 1011 1001 0010 1010 ( B A )16 f) (FEED)16 – (45C3)16 directly (1) FEED -45CD (B A)16 3/8 g) (10101)2 / (01000)2 (1) 00010.101 - > (2.A)16 01000|10101.000 -1000 001010 -1000 001000 - 1000 0000 check: 21/8 = 2.625 h) Negate (FAD)16 Is (FAD)16 originally negative or positive? (1) F F F - F -A - D (0 3)16 (FAD)16 is originally negative For 2’s complement in hex, a most significant byte of or greater represents a negative number, or less, a positive number The following number is given in BCD: 000110000100 Convert it to binary (1) (0001)BCD -> (1)10 (1000)BCD -> (8)10 (0100)BCD -> (4)10 Remainder 184 /2 -> LSB 92 /2 -> 46 /2 -> 23 /2 -> 11 /2 -> /2 -> /2 -> /2 -> MSB ans: (10111000)2 Represent the statement “X = 25/Y” in ASCII code in hex (1) Using Table 1.2 on page 14 in Tocci and Ambrosio book: X -> 58 = -> 3D -> 32 -> 35 / -> 2F Y-> 59 ans: (583D32352F59)16 What is the largest decimal number that can be represented by octal digits? By hex digits? (2) Octal: (77777777)8 = 88-1 = (16777215)10 Hex: (FFFFFFFF)16 = 168-1 = (4294967295)10 4/8 In accordance with the IEEE 754 standard, determine the decimal value of the following 32-bit single-precision floating-point number: 10001111 00111101010000000000000 (2) Sign bit = so number is positive Exponent = (10001111)2 = (143)10 – (127)10 = (16)10 Mantissa = 1.00111101010000000000000 Shift binary point by 16 places: 1.00111101010000000000000 x 216 = 10011110101000000 0000000 = 26 + 28 +210 +211 + 212 +213 +216 = (81216)10 Represent (-6.2)10 in floating-point format using the Motorola 68HC11 floating-point format (2) Negative number so sign byte is (FF)16 Convert to binary: (6)10 = (110)2 0.2 x =0.4 -> MSB 0.4 x =0.8 -> 0.8 x =1.6 -> 0.6 x =1.2 -> 0.2 … So (6.2)10 = (110.0011)2 so we will not be able to represent 6.2 exactly, but we will be close Represent in 24 bits: 110.001100110011001100110 Normalize: 0.110001100110011001100110 x 23 = (C66666)16 x 23 For Motorola floating point format, the binary point goes BEFORE the first non-zero digit when normalizing (The entire mantissa is fractional) Exponent = (80)16 + (3)10 = (83)16 Ans: (83 C66666 FF)16 5/8 Given the circuit of Figure 1, draw the timing diagram for all involved signals when the value (10)10 is transferred from register B to register A (4) Figure 10 Design Question: Your friend is paranoid that all four corners of his lawn are not experiencing the same type of weather at the same time He has gone through the trouble of designing small devices which can detect whether it is sunny, cloudy, raining or snowing and placing one at each corner of his yard These devices set one of four 6/8 external pins high for each given weather condition That is, pin is set high if it is sunny and all others are low; pin is set high if it cloudy and all others are low and so forth Your friend has a monitoring system for these devices, but it only has two input pins to accommodate all devices (16 pins in total) Design a system that can interface his devices with his monitoring system For now, ignore the fact that your friend may be insane, we’ll get him help later (6) There are other possible solutions This uses a 16 input, output MUX to pass only one of the devices through at a time Which device is chosen can be determined from the output pins O0 and O1 on the monitoring system so that it can scan through the devices as it wishes The output of the MUX is then fed to a to encoder to code the number of the high pin to a binary number For example, if the monitoring system places 01 on pins O1 and O0, the MUX will pass the output of Device B to the encoder which will output 00 for sunny, 01 for cloudy, 10 for rainy and 11 for snowy 11 Research Question: All of these answers can be found in the MC68HC11 E series data sheet at: http://www.freescale.com/files/microcontrollers/doc/data_sheet/M68HC11E.pdf There are many different subfamilies and “flavors” of the Motorola 68HC11 microcontroller One particular family is called the “E Series” a) What frequencies can this family of IC operate at? (2) MHz to dc b) On a 56 pin SDIP packaged E series chip, what pins are VRH and VRL and what are these pins used for? (4) VRH is pin 55 and VRL is pin 54 They are used as reference voltages for analog to digital conversion circuitry VRL is the low reference, typically V, while VRH is the high reference Both should be between VSS and VDD and VRH should be V greater than VRL 7/8 c) What is the difference in the CPU used by the E series and the CPU used by the D series? (1) Nothing d) What is the difference between the 68HC11E9 and the 68HC11E20 in terms of onchip memory? (4) Chip RAM ROM EPROM EEPROM E9 512 12K -512 E20 768 20K -512 8/8