circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





EQ Archive

 

May 2005, Issue 178

Test Your EQ

Each month, Test Your EQ presents some basic engineering problems for you to test your Engineering Quotient. What's your EQ?


Problem 1—What does the following C code compute? Assume that uint16 is an unsigned 16-bit integer type on this platform. Analyze its operation in mathematical terms.

#define Precision  ( 16 >> 1 ) 

uint16 Function (uint16 Number)
{
uint16 Result;
uint16 Mask;
uint16 Mask2;
uint16 Test;
uint16 Power;
	
Result = 0;
Result2 = 0;
Mask = 1 << (Precision - 1 );
Mask2 = 1L << ( ( Precision - 1 ) << 1 );
	
for (Power = Precision; Power > 0; --Power) {
	Test = Result2 + Mask2 + ((uint16)Result << Power);
	if (Test <= Number) {
      	Result2 = Test;
	Result |= Mask;
    	}
	Mask >>= 1;
	Mask2 >>= 2;
	}

	return Result;
}

Answer

Problem 2—Similarly, what does the following C code compute? Assume that uint32 is an unsigned 32-bit integer type on this platform. Again, analyze its operation in mathematical terms.

uint32 func (uint32 n)
{
   uint32 result = 0, bit, trial;
   bit = (n >= 0x10000) ? 1<<30 : 1<<14;
   do {
   trial = result + bit;
if (n >= trial) {
  n -= trial;
  result = trial + bit;
 	}
	result >>= 1;
	bit >>= 2;
	} while (bit);
	return result;
}

Answer


Problem 3—
What is the signal format used in a digital telephony T1 type of circuit?

Answer

Problem 4—What is the analog bandwidth of a T1 signal? 

Answer

Problem 5—An electric solenoid is being driven in a conventional manner, as shown below, but the solenoid is being used in a mechanical brake and the brake is releasing too slowly when the control signal is turned off. What can be done about this?

Answer

Problem 6—Sometimes a solenoid can function well with a holding current that’s less than (say, half of) its full current rating. How can you take advantage of this?

Answer

Problem 7—It’s common knowledge that you can divide a number by a power of two by doing a simple right shift of the number. What do the following relationships tell you? 

Answer

 

Problem 8—How can you evaluate a general Nth-order polynomial using just N multiplication and N addition operations?

Answer

Previous Month

   

E-mail eq@circuitcellar.com with questions or comments.