The PEP8 processor IS(Instruction Set) has both Unary (one byte) and Trinary(thr
ID: 3599686 • Letter: T
Question
The PEP8 processor IS(Instruction Set) has both Unary (one byte) and Trinary(three byte) instructions.
The Unary type does not require an operand whereas the Trinary does.
Memory is accessed ONE byte at the time and it takes 10ns to transfer ONE byte.
Consider a program, that executes one hundred instructions, where 70% of the executed instructions are Trinary and the rest(30%) are Unary.
For the Trinary instructions, the following two facts apply:
Only 10% use the Indirect('n') Addressing Mode and the rest(90%) use the Direct or Indexed Modes.
Only 10% require a one byte operand(LDBYTE/STBYTE) and the rest(90%) require a two byte operand.
Consider the four stages in the Instruction Cycle that access memory:
-FI: to retrieve an instruction;
-CO: to retrieve the 'indirect' address; and
-FO/WO: to retrieve or store. either a one or two byte operand value.
What is the Total Memory Access Time (TMAT) in ns. (nanoseconds), that is spent in the execution of this program.
SHOW and EXPLAIN EXACTLY HOW you calculate/arrive at each of the intermediate and final values.
PROVIDING values WITHOUT YOUR REASONING AND DERIVATION, EVEN IF CORRECT, WILL GET NO POINTS!!!
Explanation / Answer
#include "des56.h"
#include
#include
#include
//Use these constants to specify ENCRYPT or DECRYPT in the fencrypt function call. (The middle parameter)
#define ENCRYPT 0
#define DECRYPT 1
/*This function takes the XOR of block A and block B and stores the result in block "result"*/
/*Note that it is possible that "result" is the same as "A" (or "B").*/
/*For example:
XORblock(block1,IV,block1);
Would XOR the first block with the IV and put the result in block1*/
void XORblock(char A[8],char B[8],char result[8])
{
int i = 0;
for(;i<8;i++)
result[i] = A[i]^B[i];
}
/*This function takes a block as input and prints the corresponding hex to the terminal*/
void printhex(unsigned char block[8])
{
int i=0;
for(;i<8;i++)
printf(" 0x%x ",block[i]);
puts("");
}
void cbc_enc_three_blocks(char block1[8],char block2[8], char block3[8], char IV[8],keysched *ks)
{
// You write this code
}
void cbc_dec_three_blocks(char block1[8],char block2[8], char block3[8], char IV[8],keysched *ks)
{
// You write this code
}
int main()
{
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.