SlideShare a Scribd company logo
1 of 8
Winter ’18 CIS 314 Final A Name: SID:
1. [5] Draw a 2-input XOR circuit using only AND, OR, and
NOT gates:
2. [15] Describe the functionality of each Y86 pipeline stage
during execution of the
andl rA, rB instruction in terms of the icode, ifun, rA, rB, valA,
valB, valC, valP,
valE, valM, srcA, srcB, dstE, dstM, cnd signals (you may also
use M, R, and PC):
IF:
ID:
EX:
MEM:
WB+PC:
3. [5] Briefly describe why the stall penalty for a pipelined Y86
ret instruction is 3
cycles:
4. [15] Consider the following C procedure:
void swap(int *xp, int *yp) {
int t0 = *xp;
int t1 = *yp;
*xp = t1;
*yp = t0;
}
Write Y86 code that implements the above C procedure.
Comment your code:
5. [15] Consider the following C function:
int f(int *a, int *dest, int prod) {
*dest = prod ? 1 : 0;
for (int i = 0; i < len(a); ++i) {
if (prod) {
*dest *= a[i];
} else {
*dest += a[i];
}
}
}
Rewrite the above C function to minimize unnecessary function
calls, memory
writes, and if statements:
6. [20] Consider the following Y86 code:
mrmovl 0(%eax) %ecx
mrmovl 0(%ebx) %edx
addl %ecx %ecx
xorl %ecx %edx
a. (10) How many pipeline stalls are required when running the
above code without
data forwarding? Why? Draw a pipeline diagram to support
your answer:
b. (10) How many pipeline stalls are required when running the
above code with
data forwarding? Why? Draw a pipeline diagram to support
your answer:
7. (25) Consider a 32-byte direct-mapped cache with 8-byte
blocks for an 8-bit
machine (256 bytes of memory):
a. (5) Write a C function unsigned char getOffset(unsigned char
address) that
returns the cache offset for the specified address using bitwise
operators (assuming
the cache parameters above):
b. (5) Write a C function unsigned char getSet(unsigned char
address) that returns
the cache set for the specified address using bitwise operators
(assuming the cache
parameters above):
c. (15) If the following addresses are accessed in sequence,
which addresses will
result in cache hits and which will result in misses (assuming
the cache parameters
above and that the cache is initially empty)? For each address,
show the tag, set,
offset, and whether it resulted in hit or miss:
0x02
0x04
0x8
0x26
0x04
0x24
Winter ’18 CIS 314 Final A  Name    SID 1. [5] Draw a .docx

More Related Content

Similar to Winter ’18 CIS 314 Final A Name SID 1. [5] Draw a .docx

Similar to Winter ’18 CIS 314 Final A Name SID 1. [5] Draw a .docx (20)

Digital logic design1
Digital logic design1Digital logic design1
Digital logic design1
 
Vlsi model question paper 3 (june 2021)
Vlsi model question paper 3 (june 2021)Vlsi model question paper 3 (june 2021)
Vlsi model question paper 3 (june 2021)
 
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
 
other-architectures.ppt
other-architectures.pptother-architectures.ppt
other-architectures.ppt
 
6th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
6th Semeste Electronics and Communication Engineering (June-2016) Question Pa...6th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
6th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
 
Microprocess Microconroller mcq 1000+
Microprocess Microconroller mcq 1000+Microprocess Microconroller mcq 1000+
Microprocess Microconroller mcq 1000+
 
1st Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
1st  Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...1st  Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
1st Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
 
Cs 64
Cs 64Cs 64
Cs 64
 
5th semester Computer Science and Information Science Engg (2013 December) Qu...
5th semester Computer Science and Information Science Engg (2013 December) Qu...5th semester Computer Science and Information Science Engg (2013 December) Qu...
5th semester Computer Science and Information Science Engg (2013 December) Qu...
 
Question bank 15cs34 co
Question bank 15cs34  coQuestion bank 15cs34  co
Question bank 15cs34 co
 
8th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
8th Semeste Electronics and Communication Engineering (June-2016) Question Pa...8th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
8th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
 
A109211002 switchingtheoryandlogicdesign1
A109211002 switchingtheoryandlogicdesign1A109211002 switchingtheoryandlogicdesign1
A109211002 switchingtheoryandlogicdesign1
 
8th Semester Electronic and Communication Engineering (June/July-2015) Questi...
8th Semester Electronic and Communication Engineering (June/July-2015) Questi...8th Semester Electronic and Communication Engineering (June/July-2015) Questi...
8th Semester Electronic and Communication Engineering (June/July-2015) Questi...
 
17443 microprocessor
17443   microprocessor17443   microprocessor
17443 microprocessor
 
1st Semester M Tech CMOS VLSI Design (Dec-2013) Question Papers
1st Semester M Tech CMOS VLSI Design (Dec-2013) Question Papers1st Semester M Tech CMOS VLSI Design (Dec-2013) Question Papers
1st Semester M Tech CMOS VLSI Design (Dec-2013) Question Papers
 
Eec503, mp 30 questions
Eec503, mp 30 questionsEec503, mp 30 questions
Eec503, mp 30 questions
 
Eec503, mp 30 questions
Eec503, mp 30 questionsEec503, mp 30 questions
Eec503, mp 30 questions
 
A Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with MultithreadingA Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with Multithreading
 
microprocessor Questions with solution
microprocessor Questions with solutionmicroprocessor Questions with solution
microprocessor Questions with solution
 
Architecture of 8085
Architecture of 8085Architecture of 8085
Architecture of 8085
 

More from adolphoyonker

Without having any background knowledge on the situation of Gove.docx
Without having any background knowledge on the situation of Gove.docxWithout having any background knowledge on the situation of Gove.docx
Without having any background knowledge on the situation of Gove.docx
adolphoyonker
 
Within the field of healthcare, there are three main viewpoints .docx
Within the field of healthcare, there are three main viewpoints .docxWithin the field of healthcare, there are three main viewpoints .docx
Within the field of healthcare, there are three main viewpoints .docx
adolphoyonker
 
Within the Unit I Podcast, Chantell, Dayna, and Dr. Rogers discuss h.docx
Within the Unit I Podcast, Chantell, Dayna, and Dr. Rogers discuss h.docxWithin the Unit I Podcast, Chantell, Dayna, and Dr. Rogers discuss h.docx
Within the Unit I Podcast, Chantell, Dayna, and Dr. Rogers discuss h.docx
adolphoyonker
 
Within the last several years, Adobe Flash became the dominant forma.docx
Within the last several years, Adobe Flash became the dominant forma.docxWithin the last several years, Adobe Flash became the dominant forma.docx
Within the last several years, Adobe Flash became the dominant forma.docx
adolphoyonker
 
Within Sociology as well as in social psychology, it is noted th.docx
Within Sociology as well as in social psychology, it is noted th.docxWithin Sociology as well as in social psychology, it is noted th.docx
Within Sociology as well as in social psychology, it is noted th.docx
adolphoyonker
 
With the rapid development of the Internet, a big data era chara.docx
With the rapid development of the Internet, a big data era chara.docxWith the rapid development of the Internet, a big data era chara.docx
With the rapid development of the Internet, a big data era chara.docx
adolphoyonker
 
With this activity you will develop your analysis of a TED talk .docx
With this activity you will develop your analysis of a TED talk .docxWith this activity you will develop your analysis of a TED talk .docx
With this activity you will develop your analysis of a TED talk .docx
adolphoyonker
 

More from adolphoyonker (20)

Witness to a Crime (Major Di1. As I mentioned in this weeks lecture.docx
Witness to a Crime (Major Di1. As I mentioned in this weeks lecture.docxWitness to a Crime (Major Di1. As I mentioned in this weeks lecture.docx
Witness to a Crime (Major Di1. As I mentioned in this weeks lecture.docx
 
WitnessesVarious sources require different methods of acquiring .docx
WitnessesVarious sources require different methods of acquiring .docxWitnessesVarious sources require different methods of acquiring .docx
WitnessesVarious sources require different methods of acquiring .docx
 
Without information and knowledge, meaningful participation in .docx
Without information and knowledge, meaningful participation in .docxWithout information and knowledge, meaningful participation in .docx
Without information and knowledge, meaningful participation in .docx
 
Without having any background knowledge on the situation of Gove.docx
Without having any background knowledge on the situation of Gove.docxWithout having any background knowledge on the situation of Gove.docx
Without having any background knowledge on the situation of Gove.docx
 
Within this document you will find three primary categories of i.docx
Within this document you will find three primary categories of i.docxWithin this document you will find three primary categories of i.docx
Within this document you will find three primary categories of i.docx
 
Within the field of healthcare, there are three main viewpoints .docx
Within the field of healthcare, there are three main viewpoints .docxWithin the field of healthcare, there are three main viewpoints .docx
Within the field of healthcare, there are three main viewpoints .docx
 
Within the Unit I Podcast, Chantell, Dayna, and Dr. Rogers discuss h.docx
Within the Unit I Podcast, Chantell, Dayna, and Dr. Rogers discuss h.docxWithin the Unit I Podcast, Chantell, Dayna, and Dr. Rogers discuss h.docx
Within the Unit I Podcast, Chantell, Dayna, and Dr. Rogers discuss h.docx
 
Within the executive branch of the United States government, the p.docx
Within the executive branch of the United States government, the p.docxWithin the executive branch of the United States government, the p.docx
Within the executive branch of the United States government, the p.docx
 
Within the executive branch of the United States government, the pre.docx
Within the executive branch of the United States government, the pre.docxWithin the executive branch of the United States government, the pre.docx
Within the executive branch of the United States government, the pre.docx
 
Within the last several years, Adobe Flash became the dominant forma.docx
Within the last several years, Adobe Flash became the dominant forma.docxWithin the last several years, Adobe Flash became the dominant forma.docx
Within the last several years, Adobe Flash became the dominant forma.docx
 
Within the criminal justice system, the classification of the crime .docx
Within the criminal justice system, the classification of the crime .docxWithin the criminal justice system, the classification of the crime .docx
Within the criminal justice system, the classification of the crime .docx
 
Within Chapter 8 there is a section discussing Robert Mertons Strai.docx
Within Chapter 8 there is a section discussing Robert Mertons Strai.docxWithin Chapter 8 there is a section discussing Robert Mertons Strai.docx
Within Chapter 8 there is a section discussing Robert Mertons Strai.docx
 
Within the context of Smart Cities, many regions are employing e-tec.docx
Within the context of Smart Cities, many regions are employing e-tec.docxWithin the context of Smart Cities, many regions are employing e-tec.docx
Within the context of Smart Cities, many regions are employing e-tec.docx
 
Within Sociology as well as in social psychology, it is noted th.docx
Within Sociology as well as in social psychology, it is noted th.docxWithin Sociology as well as in social psychology, it is noted th.docx
Within Sociology as well as in social psychology, it is noted th.docx
 
within 250-300 words please describe, using reference(s) APA formatt.docx
within 250-300 words please describe, using reference(s) APA formatt.docxwithin 250-300 words please describe, using reference(s) APA formatt.docx
within 250-300 words please describe, using reference(s) APA formatt.docx
 
With which of the following statements would Thoreau most likely agr.docx
With which of the following statements would Thoreau most likely agr.docxWith which of the following statements would Thoreau most likely agr.docx
With which of the following statements would Thoreau most likely agr.docx
 
With the volatile environmental conditions surrounding CSC’s data ce.docx
With the volatile environmental conditions surrounding CSC’s data ce.docxWith the volatile environmental conditions surrounding CSC’s data ce.docx
With the volatile environmental conditions surrounding CSC’s data ce.docx
 
With the rapid development of the Internet, a big data era chara.docx
With the rapid development of the Internet, a big data era chara.docxWith the rapid development of the Internet, a big data era chara.docx
With the rapid development of the Internet, a big data era chara.docx
 
With the successful election of America’s first biracial president f.docx
With the successful election of America’s first biracial president f.docxWith the successful election of America’s first biracial president f.docx
With the successful election of America’s first biracial president f.docx
 
With this activity you will develop your analysis of a TED talk .docx
With this activity you will develop your analysis of a TED talk .docxWith this activity you will develop your analysis of a TED talk .docx
With this activity you will develop your analysis of a TED talk .docx
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Winter ’18 CIS 314 Final A Name SID 1. [5] Draw a .docx

  • 1. Winter ’18 CIS 314 Final A Name: SID: 1. [5] Draw a 2-input XOR circuit using only AND, OR, and NOT gates: 2. [15] Describe the functionality of each Y86 pipeline stage during execution of the andl rA, rB instruction in terms of the icode, ifun, rA, rB, valA, valB, valC, valP, valE, valM, srcA, srcB, dstE, dstM, cnd signals (you may also use M, R, and PC): IF: ID: EX:
  • 2. MEM: WB+PC: 3. [5] Briefly describe why the stall penalty for a pipelined Y86 ret instruction is 3 cycles: 4. [15] Consider the following C procedure: void swap(int *xp, int *yp) { int t0 = *xp; int t1 = *yp; *xp = t1; *yp = t0; } Write Y86 code that implements the above C procedure. Comment your code:
  • 3. 5. [15] Consider the following C function: int f(int *a, int *dest, int prod) { *dest = prod ? 1 : 0; for (int i = 0; i < len(a); ++i) { if (prod) { *dest *= a[i]; } else { *dest += a[i]; } } } Rewrite the above C function to minimize unnecessary function calls, memory writes, and if statements:
  • 4. 6. [20] Consider the following Y86 code: mrmovl 0(%eax) %ecx mrmovl 0(%ebx) %edx addl %ecx %ecx xorl %ecx %edx a. (10) How many pipeline stalls are required when running the above code without data forwarding? Why? Draw a pipeline diagram to support your answer:
  • 5. b. (10) How many pipeline stalls are required when running the above code with data forwarding? Why? Draw a pipeline diagram to support your answer: 7. (25) Consider a 32-byte direct-mapped cache with 8-byte
  • 6. blocks for an 8-bit machine (256 bytes of memory): a. (5) Write a C function unsigned char getOffset(unsigned char address) that returns the cache offset for the specified address using bitwise operators (assuming the cache parameters above): b. (5) Write a C function unsigned char getSet(unsigned char address) that returns the cache set for the specified address using bitwise operators (assuming the cache parameters above):
  • 7. c. (15) If the following addresses are accessed in sequence, which addresses will result in cache hits and which will result in misses (assuming the cache parameters above and that the cache is initially empty)? For each address, show the tag, set, offset, and whether it resulted in hit or miss: 0x02 0x04 0x8 0x26 0x04 0x24