Devry ECET330 All Weeks Homeworks Latest
ECET330 Microprocessor Architecture
Week 1 Homework
1 .Convert the following binary numbers to Hexadecimal.
10010011
II. 10110111
2. Find the 2’s complement of the following binary numbers.
10010101
11100111
3. Why must every computer have some amount of nonvolatile memory?
4. Find the organization and capacity of memory chips with the following pins.
EEPROM A0-A14, D0-D7
SRAM A0-A12, D0-D7
5. Answer the following:
How many bytes are 32 bits?
How many Kbytes is one megabyte?
How many megabytes is one gigabyte?
6. In a given byte-addressable computer, Memory Locations 10000H to 9FFFFHare available for user programs. The first location is 10000H and the last location is 9FFFFH. Calculate the following:
The total number of bytes available (in decimal);
The total number of kilobytes (in decimal);
7. What are the differences between a microcontroller and a microprocessor?
ECET330 Microprocessor Architecture
Week 2 Homework
1. Question: Write a simple program in which the value, $55, is added three times.
Question 2. Question: Which of the following instructions is (are) illegal?
LDAA #500
LDAA #50
LDAA #$255
STAA #50
STAA $50
LDAA 6, X
Question 3. Question: Identify the addressing mode for each of the following.
STAA $2005
LDAA #$55
STAA $55
CLRA
ADDA 0, X
Question 4. Question: Show the status of C and Z flags after each of the following codes.
LDAA #$54
ADDA #$C4
LDAA #01
ADDA #$FF
Question 5. Question: Show the status of H and N flags after the following code.
LDAA #$A1
ADDA #$0F
Question 6. Question: Define a byte-size and word-size variable starting at address $2000. Initialize both variables to $55. You should use ORG, DC.B, and DC.W directives.
ECET330 Microprocessor Architecture
Week 3 Homework
Question 1Write a program to clear Register B, and then add the number three to B seven times. Use the BNE instruction with DECA.
Question 2Write a program to clear Register A, add five to Register A 10 times, and place the result in RAM Location $2000. Use a RAM location for holding the counter.
Question 3What is the size of each instruction?
LDAA #50
BEQ there
STAA $2000
DECB
LDAB 0, X
Question 4Write the sequence of instructions to save Registers A, Y, and X in the Stack with the given order. Write the sequence of instructions to retrieve those values back.
Saving A, Y, and X in Stack:
1 __________
2 __________
3 __________
Retrieving values back:
1 __________
2 __________
3 __________
Question 5Show code for a nested loop to perform an action 1,000 times.
ECET330 Microprocessor Architecture
Week 4 Homework
Question 1Write a program to get eight-bit data from PORTA and send it to PORTB and PORTC. Make sure to define each port as input or output.
Question 2Write a program to toggle all bits of PORTA continuously by sending $55 and $AA to it.
Question 3Write a program to toggle PB3, PB7, and PB5 continuously without disturbing the rest of the bits. Assume that there is a delay procedure that you can call.
Question 4Write a program to monitor Bit PJ3, which is connected to a switch. When it is HIGH, send 55H to the output port, PORTB. You also need to define the PJ3 bit as an input port, and PORTB as an output port.
Question 5Eight switches are connected to PORTB and eight LEDs are connected to PORTA. We would like to monitor the first two least significant bits of PORTB (use masking technique). Whenever both of these bits are set, switch all LEDs of Port A on for one second. Assume that the name of the delay subroutine is DELAY. You do not need to write the code for the delay procedure.
ECET330 Microprocessor Architecture
Week 5 Homework
Question 1. Show the value of the register and the carry after the execution of the ASLA instruction.
Given the original content of Register A and carry flag
0 1 0 0 1 0 1 0 1
C
Question 2. Show the value of the register and the carry after the execution of the LSLB instruction.
Given the original content of Register B and carry flag
0 1 0 0 1 0 1 0 1
C
Question 3. Show the value of the register and the carry after the execution of the ASRB instruction.
Given the original content of Register B and carry flag
1 0 1 0 0 1 0 1 0
C
Question 4. Show the value of the register and the carry after the execution of the RORA instruction.
Given the original content of Register A and carry flag
1 1 0 1 1 1 1 1 0
C
Question 5. Show how to perform 77 x 34 in the HCS12. Store the result in a WORD-size variable called var1.
Question 6. Show how to perform 77 / 3 in the HCS12. Store the quotient in a WORD-size variable called result, and the remainder in a WORD-size variable called remainder.
Question 7. How are the following decimal-signed numbers represented in HCS12?
-12
+127
-128
ECET330 Microprocessor Architecture
Week 6 Homework
Question 1. Write a program to continuously read the DIP switches connected to PORTA and send it to PORTB.
Question 2. Assume that eight DIP switches are connected to PORTB and eight LEDs are connected to PORTC. Assume that the switch values are normally high. Turn all of the LEDs on and wait in a loop until one of the switches becomes zero. At that time, send 0x55 to PORTC.
Question 3. Write a C program to declare two character arrays called list1 and list2. Initialize list1 with your first and last name. Write the main code to copy list1 to list2.
Question 4. Write a function to convert a character to uppercase (if it is lowercase) and return the character. Hint: Subtracting 0x20 from the ASCII code of a lowercase character makes it an uppercase.
Question 5. Write a C program to convert a packed BCD at Port B to ASCII and display the bytes on PORTC and PORTD.
ECET330 Microprocessor Architecture
Week 7 Homework
1.Is it possible to interface an IC with a different technology such as TTL to HCS12 ports? What are the conditions in terms of electrical parameters that need to be satisfied for this purpose?
2.Given an LED with a forward drop of 1.5V and an operating current of 10 mA, design the interface to the HCS12 showing your calculations.
3.Bit 4 of Port B is connected to a switch that normally outputs a zero. Monitor this switch to detect a change from zero to one. Immediately when it becomes one, call a function to toggle Bit 5 of Port B, which is connected to an LED. Use an exclusive-OR operation to toggle PB5 two times. After the function call, the code should branch to the line that monitors PB4.
4.Write a program to create an array initialized with Hex digits in the ROM space. The main code should copy this array to a different array in the RAM space.
5.What is the function of the enable control input of a tri-state buffer? If the output of two or more tri-state buffers is connected to each other, what is the restriction on enable control input lines? What does happen when this restriction is violated?
6.In your own words, describe bus contention and how to avoid this problem. What techniques are used in modern computer systems to avoid bus contention?

Having Trouble Meeting Your Deadline?
Get your assignment on Devry ECET330 All Weeks Homeworks Latest completed on time. avoid delay and – ORDER NOW