1. Engineering
  2. Computer Science
  3. its a computer system course just explain the answer and...

Question: its a computer system course just explain the answer and...

Question details

*conditional - same as x? y: z Example: conditional(2,4,5) 4 Legal ops: -& A+<< >> Max ops: 16 Rating: 3 int conditional (int x, int y, int z) f //if x != 0, subtract 1 from 0 0xffffffff //else if x 0, subtract 1 from 1 => 0x00000000 //if x-0, y gets masked out /lif x1-0, z gets masked out int mask = (1x + ~0x80); return ((-mask) & z) I ((mask) & y); * ISAS CİİDigit - return 1 if 0x30 < x <= 0x39 (ASCII codes for characters 0 to 9) İsAsciiDigit(0x35) 1 isAsciiDigit(0x3a)0 ISASCİİDigit(0x85) -0 Example: Legal ops: -& A+<< >> Max ops: 15 Rating: 3 int isAsciiDigit(int x) t //Initialize the sign integer and the limits //If 30x39 and <0x30 are added, we get a negative value //Adds x and checks for signs, returns whether its in range or not //Negative value is not in range, Positive is in range int negative- 1(<31; int lessthan(negative 0x39); int greatthan- ~(ex30); lessthannegative & (lessthan+x) >> 31; greatthan- negative & (greatthan+1+x) >31; return (lessthan lgreatthan);

It's a computer system course. Just explain the answer and If u were asked to do this, how would you approach the answer.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution