SOLUTION-MANUAL- EMBEDDED-SYSTEMS-1ST-EDITION-RAJ-KAMAL
SOLUTIONS TO THE EXERCISES – Chapter 2 17. A two by three matix multiplies by another three by two matrix. If data tranfer from a register to another takes 2 ns, addition takes 20 ns, multiplication takes 50 ns, what will be the execution time. How will a MAC unit help, assume that these times are same in a DSP with a MAC unit? . When a two by three matix A multiplies by another three by two matrix B, a new three by three matrix with total 9 new elements generates. Assume there are only four registers, R1 and R2 for the 8-bit operands and R3 and R4 for saving the results of multiplication of R1 and R2 or result of addition of 16-bit R1-R2 with 16 bit. R3-R4. Without a MAC unit Before the multiplications, two elements A11 and B11 transfer to the registers R1 and R2. This takes 2 . 2 ns = 4 ns. Mulrplication will take another 50ns and let the result is in R4 and R3. To save these, it will take another 4 ns. Total time taken is 58 ns. Now R2 are again given another element B21. This takes 2 ns. Now multiplication takes another 50 ns and transfer another 4ns. This operation will take another 56 ns. Now R2 is again given another element B31, The multiplication and save takes totla 56 ns. Now the results of above three operations are to be added. Total number of register to register additions will be 4. Time taken will be 2 * (4 ns + 4 ns + 20 ns + 4 ns) = 64 ns. A new matrix C element C11 takes (58 + 56 + 56) ns + 64 ns = 234 ns. For nine elements of C, the matix multiplitication will take 2106 ns. With a MAC unit like in a DSP A MAC does a single cycle MAC. Hence, it take 2 ns for a MAC operation. For finding each element of C, it will take 4 ns + 2 ns. Total time will be only 9 * (6 ns) = 54 ns. Therefore a MAC unit is essential for certain operations. 18. An array has 10 integers, each of 32-bits. Let an integer be equal to its index in the array multiplied by 1024. Let the base- address in memory be 0x4800. How will the bits be stored for the 0th, 4th and 9th element in (a) big-endian mode (b) little endian mode. Ten integer and their saving at the 32-bit memory as big endian and little endian Index Integer Big endian Little endian 0 0 0000 0000 1 1024 0000 2 2048 0000 3 3072 0000 4 4096 0000 0000 5 5120 0000 0000 6 6144 0000 0000 7 7165 0000 0000 8 8192 0000 0000 9 9216 0000 0000 0000 Note that first 8 bits in little endian becomes last eight bits in big endian. Next 8 bits in little endian becomes last but one 8 bits. 19. We can assume that the memory of an embedded system is also a device. List the reasons for it. [Hint: Use of pointers like access control registers and the concept of virtual file and RA
Escuela, estudio y materia
- Institución
- ECON 232
- Grado
- ECON 232
Información del documento
- Subido en
- 30 de junio de 2024
- Número de páginas
- 6
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas
Temas
-
solution manual embedded systems