Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (5 pts.) PicoBlaze Architecture Answer the following questions about the PicoBlaze Architecture: a. List all storage units and what kind of data they can

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

1. (5 pts.) PicoBlaze Architecture Answer the following questions about the PicoBlaze Architecture: a. List all storage units and what kind of data they can store (data, instructions, addresses)? b. What is the address range (in hex) for the instruction PROM? c. How many cycles does an instruction consume? d. What is the purpose of NOP instruction? e. Do we have instructions that directiymanipulate the call/return stack? f. How many clock cycles does instruction decode take? g. What is the purpose of the interrupt input? h. What flags does the "test" instruction affect? i. When we execute a call instruction, does the PicoBlaze save the register file contents? j. What is the difference between ADD and ADDCY instructions? Explain why we need two variants of ADD instructions? 2. (8 pts.) Simple Loopback System: Consider a simple "loopback" system as in Fig. 1. In such a setup, a PC can send a message which is returned (looped) back to PC by the processor. Such a loopback test is helpful to test if the processor is alive or not. A PC (not shown) interfaces with PicoBlaze processor using an RS232 (serial) connection. Let us examine the case when the PC acts as a transmitter. In this case the data arrives serially on RS232_RX line. But we know that PicoBlaze accepts only byte-size data. So we need to convert the serial data into parallel (8-bit) data. In such a case, a UART (Universal Asynchronous Receiver Transmittei) block can help. UART RX does the serial-to-parallel conversion, i.e., the data arrving on RS232 RX line is buffered in a 16-byte buffer. Whenever new data is presented on rx data output, UART_RX will assert data-present, i.e., data-present-'l'in other words data present validates rx-data. The "Input Port Logic" block consists of glue logic that connects UART_RX to the IN_PORT. After PicoBlaze reads the data, it can request the next data item by asserting read from uart signal. Now, let us consider the case when PicoBlaze acts as a transmitter i.e., PC is the receiver. In this case PicoBlaze puts out 8-bit data while PC is expecting serial data. Agai, UART (UART_TX in Fig. 1) comes to our rescue! The output bus with id-3 is connected to UART_TX. Output Port Logic block interfaces PicoBlaze with LEDs and UART_TX. main xor s0, s0 INDEX TO LOOP THROUGH ADDRESSES next letter input s3, buffer_full compare s3, 01 jump z, bufferfull_call fetch sl, (s0) add s0, 01 CHECK IF BUFFER IS FULL ;JUMP IF UART TX FULL FETCH NEXT LETTER AND THEN INCREMENT ADDRESS ready buffer: output si, uart_data tx compare s0, 14 jump nz, next letter um led echo OUTPUT LETTER TO UART TX CHECK IF WE REACHED END OF MESSAGE TO END JUMP TO LED ECHO buffer full_call: load sF, SF jump next letter BUFFER FULL STALL JUMP BACR AND RE-CHECR BUFFER FULL (1 pts.) led echo and rs232-echo: Explain the code below to read switches and write it, nverted, to the LEDs. Explain the code below to check if a byte has been received by UART_RX. If so, send it back to PC via UART TX. c) led echo: LOAD input s0, switches xor s0, FF output so, leds s0, s0 i(nop) TAKE INPUT FROM SWITCHES AND RETURN INVERTED TO LEDS ump rs232_echo JUMP TO RS232 ECHO rs232 echo: s0, s0 LOAD xor sl, sl xor s2, 2 input s1, uart_data rx input s2, data present compare s2, 01 jump z, s nd back jump led echo (nop) CLEAR S1 CLEAR S2 READ FROM RX AND STORE IN S1 ;CHECK IF DATA PRESENT FOR RX ;IF DATA PRESENT JUMP TO SEND BACK IF NO DATA PRESENT REEP WAITING send back: output s1, uartdata tx jump led echo OUTPUT s1 TO TX JUMP BACK TO LED ECHO 3. (2 pts.) FSM: Draw the state diagram of a Mealy machine which accepts a binary stream and outputs a 'l'whenever it detects a pattern "111". Overlapping sequences are allowed. For example: Input Stream 11010010 1 Output: 001100011 10 0 000 Perform binary state encoding. Show the tabular representations of next state and output functions Derive minimized Boolean equations for next state and output functions. You do not need to draw vour circuit. 1. (5 pts.) PicoBlaze Architecture Answer the following questions about the PicoBlaze Architecture: a. List all storage units and what kind of data they can store (data, instructions, addresses)? b. What is the address range (in hex) for the instruction PROM? c. How many cycles does an instruction consume? d. What is the purpose of NOP instruction? e. Do we have instructions that directiymanipulate the call/return stack? f. How many clock cycles does instruction decode take? g. What is the purpose of the interrupt input? h. What flags does the "test" instruction affect? i. When we execute a call instruction, does the PicoBlaze save the register file contents? j. What is the difference between ADD and ADDCY instructions? Explain why we need two variants of ADD instructions? 2. (8 pts.) Simple Loopback System: Consider a simple "loopback" system as in Fig. 1. In such a setup, a PC can send a message which is returned (looped) back to PC by the processor. Such a loopback test is helpful to test if the processor is alive or not. A PC (not shown) interfaces with PicoBlaze processor using an RS232 (serial) connection. Let us examine the case when the PC acts as a transmitter. In this case the data arrives serially on RS232_RX line. But we know that PicoBlaze accepts only byte-size data. So we need to convert the serial data into parallel (8-bit) data. In such a case, a UART (Universal Asynchronous Receiver Transmittei) block can help. UART RX does the serial-to-parallel conversion, i.e., the data arrving on RS232 RX line is buffered in a 16-byte buffer. Whenever new data is presented on rx data output, UART_RX will assert data-present, i.e., data-present-'l'in other words data present validates rx-data. The "Input Port Logic" block consists of glue logic that connects UART_RX to the IN_PORT. After PicoBlaze reads the data, it can request the next data item by asserting read from uart signal. Now, let us consider the case when PicoBlaze acts as a transmitter i.e., PC is the receiver. In this case PicoBlaze puts out 8-bit data while PC is expecting serial data. Agai, UART (UART_TX in Fig. 1) comes to our rescue! The output bus with id-3 is connected to UART_TX. Output Port Logic block interfaces PicoBlaze with LEDs and UART_TX. main xor s0, s0 INDEX TO LOOP THROUGH ADDRESSES next letter input s3, buffer_full compare s3, 01 jump z, bufferfull_call fetch sl, (s0) add s0, 01 CHECK IF BUFFER IS FULL ;JUMP IF UART TX FULL FETCH NEXT LETTER AND THEN INCREMENT ADDRESS ready buffer: output si, uart_data tx compare s0, 14 jump nz, next letter um led echo OUTPUT LETTER TO UART TX CHECK IF WE REACHED END OF MESSAGE TO END JUMP TO LED ECHO buffer full_call: load sF, SF jump next letter BUFFER FULL STALL JUMP BACR AND RE-CHECR BUFFER FULL (1 pts.) led echo and rs232-echo: Explain the code below to read switches and write it, nverted, to the LEDs. Explain the code below to check if a byte has been received by UART_RX. If so, send it back to PC via UART TX. c) led echo: LOAD input s0, switches xor s0, FF output so, leds s0, s0 i(nop) TAKE INPUT FROM SWITCHES AND RETURN INVERTED TO LEDS ump rs232_echo JUMP TO RS232 ECHO rs232 echo: s0, s0 LOAD xor sl, sl xor s2, 2 input s1, uart_data rx input s2, data present compare s2, 01 jump z, s nd back jump led echo (nop) CLEAR S1 CLEAR S2 READ FROM RX AND STORE IN S1 ;CHECK IF DATA PRESENT FOR RX ;IF DATA PRESENT JUMP TO SEND BACK IF NO DATA PRESENT REEP WAITING send back: output s1, uartdata tx jump led echo OUTPUT s1 TO TX JUMP BACK TO LED ECHO 3. (2 pts.) FSM: Draw the state diagram of a Mealy machine which accepts a binary stream and outputs a 'l'whenever it detects a pattern "111". Overlapping sequences are allowed. For example: Input Stream 11010010 1 Output: 001100011 10 0 000 Perform binary state encoding. Show the tabular representations of next state and output functions Derive minimized Boolean equations for next state and output functions. You do not need to draw vour circuit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions

Question

2. Distinguish between probability and nonprobability sampling.

Answered: 1 week ago