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

"24d16" - 2 õppematerjali

Mikrokontrollerid ja robootika homework 1
14
pdf

Mikrokontrollerid ja robootika homework 1

a) 121 – 185 = -64 121 in 16-bit binary is 0000 0000 0111 1001 -185 in 16-bit binary is 1111 1111 1011 1001 -64 in 16-bit binary is 1111 1111 1100 0000 00000000 01111001 + 11111111 10111001 --------------------------- 11111111 11000000 b) -70 – 88 = -158 11111111 10111010 - 00000000 01011000 ------------------------- 11111111 01100010 5. Calculate the following without converting the number base. Show calculations. 3A916 + 24D16 = 5F616 3A9 + 24D --------- 5F6 9 + D = 16 A+4+1=F 3+2=5 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. 1 byte = 8 bits Shift left = X ∗ 2𝑛 , where n stands for how big the shift is. 23 = 8, so we have to shift left by 3. Y = X shl 3 // shifts left by 3 bits, filling the empty bits on the right with zeros 7

Mehhatroonika → Mikrokontrollerid ja robootika
6 allalaadimist
Mictrocontroller Week 03
14
pdf

Mictrocontroller Week 03

=== 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

Mehhatroonika → Mehhatroonika
5 allalaadimist


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