Vajad kellegagi rääkida?
Küsi julgelt abi LasteAbi
Logi sisse

Mictrocontroller Week 03 (0)

1 Hindamata
Punktid

Lõik failist

Mictrocontroller Week 03 
Numbering systems 
1. Convert the decimal number 123.456 to the  following  formats, taking   whole numbers and 
fractions into account . Show calculations. 
a) binary  
b) hexadecimal 
c) base -5 
d) BCD 
=== 
1. a) 0111 1011.0111 01002 
b) 7B.7416 
c) 443.2125 
d) 0001 0010 0011.0100 0101 01102 
=== 
2. Extend the following unsigned 8-bit binary numbers to their 16-bit equivalents and convert 
the result  to hexadecimal. 
a) 011010112 
b) 101101012 
=== 
2. a) 006B 
b) 00B5 
=== 
3. Extend the following signed two’s complement 8-bit binary numbers to their 16-bit 
equivalents and convert the result to hexadecimal. 
a) 011010112 
b) 101101012 
=== 
3. a) 006B 
b) FFB5 
=== 
Logic and arithmetic 
4. Using two’s complement arithmetic, calculate the following ( choose  a  suitable  number of 
bits for the representation): 
a) 121 – 185 
b) -70 – 88 
== 
4. Convert back to verify  answer 
== 
5. Calculate the following  without  converting the number base. Show calculations. 
a) 3A916 + 24D16 
== 
5.   
5F616 
== 
6. Variable X contains the number of bytes to be read from an external device. Using a binary 
shift , write one line of pseudocode to calculate the number of bits to be read and store  the 
result in Y. 
== 
6. Y = X shl 3  // shifts left by 3 bits, filling the emply bits on the right with zeros (3 bits) 
== 
7. You have two Boolean variables A and B. Write down a logic expression using only the 
operators AND, OR and NOT that will evaluate to true if A and B are equal and to false  
otherwise. 
== 
7. (A and B) or ((not A) and (not B)) 
== 
8. You have two strings stored in variables S1 and S2. Both strings are stored in ASCII  format  
and contain 8 bits per  character and 20  characters  per string . Write pseudocode that will 
compare the strings without  case  sensitivity and return a Boolean result in variable Y 
indicating whether the strings match or not. 
== 
8. Y = true 
for i from 1 to 20 
for j from 1 to 8, excluding 3 //  first bit is spared (omitted) and the second (third) bit for  upper  
bitindex = j + (i-1)*8  
if S1[bitindex] ≠ S2[bitindex] 
Y = false 
Exit  loop  
end 
end 
end 
 
== 
 
 
 
 
 
 

CPU architecture  
9. Suppose a microprocessor adds the numbers shown below respectively. In each instance  
explain the influence  of the computation on the flag  register in terms of each of the flag bits Z, 
N, C, and V. Assume the processor can handle  8-bit binary values using a two’s compliment 
representation. 
a) 60 + 80 
b) 60 – 80 
== 
The N, Z, C, and V bits are the  condition   code  flags, conditions code flags to be set or cleared (0 or 1). 
1. N = 0; Z = 0; C = 0; V = 0 
2. N = 0; Z = 1; C = 0; V = 0 
3. N = 0; Z = 1; C = 1; V = 0 
4. N = 1; Z = 0; C = 0; V = 0 
5. N = 0; Z = 0; C = 1; V = 0 
6. N = 1; Z = 0; C = 1; V = 0 
7. N = 1; Z = 0; C = 0; V = 1 
8. N = 0; Z = 0; C = 1; V = 1 
9. N = 0; Z = 1; C = 1; V = 1 
9. a) V and C 
b) N 
== 
 
Input and output 
10. You have  four  PROM modules like the below figure and a sufficient collection of logic 
gates . Drawcircuit   diagram showing how you can implement  4 kB of MP addressable 
memory  to your Microprocessor with12 address bits. 
 
PROM (Programmable Read Only Memory) scheme has 10 address pins  
== 
10. There  was an  error in the question. Assume the PROM module  to be used has only 10 
address pins. The input consists of 12 address bits. Use the most significant 2 bits to select
memory  chip and the  least significant 10 bits to select an address within the chip. The least 
significant 10 bits of the input address are thus connected to the 10 address bits of each 
memory module and the most significant 2 bits are connected to NOT and AND gates and 
then to the chip select pins, such that only one chip will be  active  for each input combination 
and all  chips are used. The data output pins of the memory modules are connected to OR 
gates to provide  the final  8-bit output. 
 
PROM (Programmable Read Only Memory) 
With 10 pins or 10 bits, a PROM can address 210 which is 1024 memory locations = 1 kB 
Four PROM chips will have 4 kB of addressable memory 
 
Microprocessor (12 address bits) can  access  212 = 4096 = 4 kB locations (0x1000) 
Connect MP address lines A9-A0 to PROM's A9-A0 pins 
But what do we do with MP's A11 and A10 address lines?  
Connect by the below    ==> each PROM chip will be selected  upon  the state (1 or 
0) of MP's A11 and A10 lines  
     So addresses 00  00 0000 0000 - 00  11  1111  1111 (0x000-0x3FF)  
                           01  00 0000 0000 - 01  11 1111 1111 (0x400-0x7FF)  
                           10  00 0000 0000 - 10  11 1111 1111 (0x800-0xBFF)  
                           11  00 0000 0000 - 11  11 1111 1111 (0xC00-0xFFF)  
 
 
 
 
Three inputs NAND  chip and scheme 
Scheme used four of the PROM chips and four three-input NAND gates (CS = 
chip select pins

 
Scheme to coonect 12 input pins MP address to four PROM 10 address pins 
== MEMR (Merory Read) 
 
11. You are designing a  multi - user   interface  that stores user preference data on external 
memory. You decided to use a PIC18F45K20 microcontroller and 24C02C  EEPROM  
memory. Your microcontroller needs to  generate a block wave  that will act as a  clock signal  
to synchronize data  transfer to and from the memory. 
a) Choose a suitable clock frequency , based on the capabilities of the EEPROM module 
and the PIC. 
b) Assume the clock frequency of the PIC is 16 MHz and one instruction cycle  lasts 4 
clock periods.  Further  assume that one loop of your algorithm requires 4 
instruction cycles. Determine the total delay  time for completing a command cycle sent to 
EEPROM, assuming the clock in EEPROM is 100 kHz. 
== 
11. a) Choose 0 – 400 kHz 
Check   internet : PIC18F45K20 clock modes up to 64 MHz 
Check internet : 24C02C EEPROM maximum  clock frequency 0.4 MHz 
 
b) Assume a 100 kHz EEPROM clock = 1/100,000 sec = 10 μs. 
PIC clock is 16 MHz=1/16,000,000 = 1/16 μs. 
One instruction to PIC lasts 4*1/16 μs = ¼ μs 
One loop command to PIC lasts 4*4*1/16 = 1 μs  
The delay for one cycle of EEPROM should be 0.5 cycle (for the signal changing state) or 
needs 10*0.5 = 5 μs 
Delay time for completing one command cycle is 5 μs + 1 μs = 6 μs
== 
 
12. You are designing an embedded system and need to communicate with a computer 
motherboard using an RS-232 interface. You decided to use a MAX232 driver to convert 
between the voltage  levels used by the PIC and those used by the RS-232 port ( find
MAX232 datasheet on the internet). You are using a PIC18F45K20. Indicate, on the 
following diagram, how you would connect the PIC, the MAX232 and the RS-232 port. 
 
== 
12. Connect the following pins: 
Vasakule Paremale
Mictrocontroller Week 03 #1 Mictrocontroller Week 03 #2 Mictrocontroller Week 03 #3 Mictrocontroller Week 03 #4 Mictrocontroller Week 03 #5 Mictrocontroller Week 03 #6 Mictrocontroller Week 03 #7
Punktid 50 punkti Autor soovib selle materjali allalaadimise eest saada 50 punkti.
Leheküljed ~ 7 lehte Lehekülgede arv dokumendis
Aeg2015-03-02 Kuupäev, millal dokument üles laeti
Allalaadimisi 5 laadimist Kokku alla laetud
Kommentaarid 0 arvamust Teiste kasutajate poolt lisatud kommentaarid
Autor wyoming Õppematerjali autor
Õppejõu enda lahendus Kodutöö 1 kohta.

Sarnased õppematerjalid

thumbnail
14
pdf

Mikrokontrollerid ja robootika homework 1

Mictrocontroller Week 03 Numbering systems 1. Convert the decimal number 123.456 to the following formats, taking whole numbers and fractions into account. Show calculations. a) Binary Fractional part : Reading direction Integral part: Reading direction 0,456 x 2 = 0,912 0 123 / 2 = 61 1 0,912 x 2 = 1,812 1 61 / 2 = 30 1 0,812 x2 = 1,624 1 30 / 2 = 15 0

Mikrokontrollerid ja robootika
thumbnail
402
pdf

CPM1A Programmable Controllers Operation Manual 1784470

Cat. No. W317-E1-11 SYSMAC CPM1A Programmable Controllers OPERATION MANUAL CPM1A Programmable Controllers Operation Manual Revised October 2007 iv Notice: OMRON products are manufactured for use according to proper procedures by a qualified operator and only for the purposes described in this manual. The following conventions are used to indicate and classify precautions in this manual. Always heed the information provided with them. Failure to heed precautions can result in injury to people or dam- age to property. ! DANGER Indicates an imminently hazardous situation which, if not avoided, will result in death or serious injury. Additionally, there may be severe property damage. ! WARNING Indicates a potentially hazardous situation which, if not avoided, could result in death or serious inju

Automatiseerimistehnika
thumbnail
568
pdf

Book Analog Interfacing to Embedded Microprocessors

Analog Interfacing to Embedded Microprocessors Real World Design Analog Interfacing to Embedded Microprocessors Real World Design Stuart Ball Boston Oxford Auckland Johannesburg Melbourne New Delhi Newnes is an imprint of Butterworth–Heinemann. Copyright © 2001 by Butterworth–Heinemann A member of the Reed Elsevier group All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Recognizing the importance of preserving what has been written, Butterworth–Heinemann prints its books on acid-free paper whenever possible. Library of Congress Cataloging-in-Publication Data Ball, Stuart R., 1956– Analog interfacing to embedded microprocessors : real world design / Stuart Ball. p. cm. ISBN 0-7506-7339-7 (pbk. : alk. paper) 1. Embedded computer

Mehhatroonika
thumbnail
3
doc

Tööstuslik andmeside kontrolltöö 2 abimaterjal - vastused

oData transparency: In bit and byte oriented protocols, there is a problem if a control character (for ETX (End of Text) ·Same as ETB, only no more blocks will follow. ITB (End of > Differences with HDLC ­ length of protocol field (1B or 2B) byte-oriented protocols) or the start-of-frame flag (for bit-oriented protocols) appears in the actual data. Intermediate Transmission Block) ·Same as ETB, except that the receiving statio Differs from HDLC because of multiaccess MAC that provides · Maximum payload length (default: 1500) This was not likely to happen in ASCII text, but is very likely with binary data. This is known as a data will not acknowledge after the error checking. EOT (End of Transmission) framing/error detection: · Type of CRC (2B or 4B) transparency problem an can be rectified with byte stuffing (for byte-orien

Tööstuslik andmeside
thumbnail
555
doc

Programmeerimiskeel

tutvu lausearvutuse keskkonnaga: http://logik.phl.univie.ac.at/~chris/gateway/formular-uk-zentral.html Millistel muutuja väärtustel on lause (Av(B&A))v(-A&(Cv(B&-C))) väär? Panna tuleb results only, 0 on väär 1 on õige Tutvu ajalooga saidis kuni II maailmasõda: http://www.maxmon.com/history.htm Loe läbi jutt ja proovi andmetega mängida: http://math.hws.edu/TMCM/java/DataReps/index.html Kahend süsteemi arvu(101101001) ->kümnend süsteemiks. Nr sisse ja bianarile punkt, ja vaatan base ten integeri kümnendarvudest annab Ecki appletis juuresoleva graafilise kujutise, teen kujundi ja vaatan base integeri mis vastab kahendsüsteemi arvule 1110001 ASCII tabelis? Nr sisse ja punkt bianari, vaatan ...teksti Kümnendsüsteemi arv 33 on kahendsüsteemis? 33 kirjutan ja Base-ten integer, vaatan bianary Loe läbi jutud Atbashi ja Caesari šifri (Caesar cipher) kohta: http://www.wikipedia.org 2 Tutvu ajalooga kuni 1970ndad: http://www.islandnet.com/~kpolsson/comphist/ 47-68 ingli

Infotehnoloogia
thumbnail
2
docx

Homework 01

Homework 1. a)123/2= 61,5; 61/2=30,5; 30/2=15; 15/2=7,5; 7/2= 3,5; 3/2=1,5 (1111011) 0.456*2=0.912; 0,912*2=1,824; 0,824*2=1,648; 0,648*2=1,296; 0,296*2=0,592; 0,592*2=1,184; 0,184*2=0,368; 0,368*2=0,736; (0,736*2=1,472; 0,472*2=0,944; 0,944*2=1,888) So b)123/16= 7,6875 ; 0,6875*16=11 ; 7/16 is less than one, then hex is 7B 0,456*16= 7,296 ; 0,296*16=4,736; 0,736*16=11,776; 0,776*16=12,416; 0,416*16=6,656; 0,656*16=10,496; 0,496*16=7,936; 0,936*16=14,976; 0,976*16=15,616; 0,616*16=9,856; 0,856*16=13,696; 0,696*16=11,136; 0,136*16=2,176; 2,176*16=2,816; 0,816*16=13,056 Hex is 7B.74BC6A7EF9DB22D c) 123,456/5=24,6912/5=4,93824/5=0,987648 0,987648*5=4,93824; 0,93824*5=4,6912; 0,6912*5=3,456; 0,456*5=2,28; 0,28*5=1,4; 0,4*5=2; 0*5=0 base-5 is d)BCD is 2. a) Unsigned 16-bit binary is 0000000001101011. Hexadecimal is 6B b) Unsigned 16-bit binary is 0000000010110101. Hexadecimal is B5 3. a) Signed two's c

Mikrokontrollerid ja praktiline robootika
thumbnail
5
docx

Emaplaadi terminite sõnastik inglise keeles

Motherboard - the principle printed circuit board assembly in a computer; includes core logic (chipset), interface sockets and/or slots, and input/output (I/O) ports. Printed circuit board (PCB) - a thin, laminated sheet composed of a series of epoxy resin and copper layers and etched electronic circuits (signal, ground and power) Chipset (or core logic) - two or more integrated circuits which control the interfaces between the system processor, RAM, I/O devises, and adapter cards. Processor slot/socket - the slot or socket used to mount the system processor on the motherboard AGP - Accelerated Graphics Port - a high speed interface for video cards; runs at 1X (66MHz), 2X (133MHz), or 4X (266MHz). PCI - Peripheral Component Interconnect - a high speed interface for video cards, sound cards, network interface cards, and modems; runs at 33MHz. ISA - Industry Standard Architecture - a relatively low speed interface primarily used for sound cards and modems; runs at approx. 8MHz. RAM - Ran

Arvutitund
thumbnail
14
pdf

Mikrokontrollerid ja robootika homework 2

Question 1 Define the following ADC terms: 1. SNR – (Signal to Noise Ratio) SNR is a calculated value that represents the ratio of RMS signal to RMS noise. 2. SINAD - (signal-to-noise-and-distortion ratio) Ratio of the RMS signal amplitude to the mean value of the root-sum-square (RSS) 3. ENOB – (effective number of bits) The effective number-of-bits and relates to SINAD 4. THD - (total harmonic distortion) Ratio of the rms value of the fundamental signal to the mean value of the RSS of its harmonics. 5. SFDR - (spurious free dynamic range) Ratio of the RMS value of the signal to the RMS value of the worst spurious signal. 6. Channels - related to the inputs of the ADC can either be multiplexed or individually selected. 7. Linearity - relates to how a ADC follows a linear function. All ADCs are to a certain extend nonlinearity. 8. Operating temperature - measurement, which i

Mikrokontrollerid ja robootika




Meedia

Kommentaarid (0)

Kommentaarid sellele materjalile puuduvad. Ole esimene ja kommenteeri



Sellel veebilehel kasutatakse küpsiseid. Kasutamist jätkates nõustute küpsiste ja veebilehe üldtingimustega Nõustun