ps1 - using a compiler. Describe a scenario when the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 468 Problem Set 1: Compiler basics 1. Consider a machine with no branch predictors ( i.e. , the hardware does not use past behavior to tell whether a branch will be taken or not taken). Instead, the machine’s ISA allows a compiler to set a flag on each branch indicating if the branch is usually taken or usually not taken. Which kind of compiler would you expect to perform better for this machine: a static compiler (like gcc)? Or a just-in-time compiler? Explain. 2. Using the production rules of MICRO, give a derivation of the program: BEGIN id := id - id; READ(id); END . Is this the only possible derivation? 3. Describe a scenario where writing code directly in assembly might be preferable to
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: using a compiler. Describe a scenario when the opposite is true. 4. Give a regular expression that matches valid email addresses. A valid email address, for the purposes of this problem, consists of a string of alphanumeric characters, followed by an @ sign, followed by a domain name that is a string of alphanumeric characters followed by .com or .edu Subdomains are allowed. For example, the following are valid email addresses:, and the following are not:, 1...
View Full Document

This note was uploaded on 02/19/2012 for the course ECE 468 taught by Professor Test during the Fall '08 term at Purdue University-West Lafayette.

Ask a homework question - tutors are online