# Texas Instruments Technical Exam - September 2005

Posted on :22-02-2016
Texas Instruments Technical Exam - September 2005:-

Q1. Variables of function call are allocated in

a) registers and stack
b) registers and heap
c) stack and heap

Q2. There are 5 pipe line and another 12 pipe line states are there and flushed time taken to execute five instructions

a) 10,17
b) 9,16
c) 25,144

Q3. In a circuit, a resistor R & a capacitor C are connected in parallel. To this circuit another circuit which is having a capacitor of capacity 2C & an impedence  Z, is connected in series. What is the value of Z? Note that 2C & Z are connected in series.

a) Z=2C
b) Z=2L
c) Z=L/2
d) Z=2R

Q4. char a[5]=hello

a) in array we cant do the operation .
b) size of a is too large
c) size of a is too small
d) nothing wrong with it.

Q5.
struct a
{
int a;
char b;
int c;
}

union b
{
char a;
int b;
int c;
};

which is correct?

a) size of a is always diff. form size of b
b) size of a is always same form size of b.
c) we cant say anything because of not-homogeneous (not in ordered)
d) size of a can be same if

ANS: a

Q6. size of(int)

a) always 2 bytes
b) depends on compiler that is being used
c) always 32 bits
d) cant tell

Q7.
main(){
char str[5]=hello;
if(str==NULL) printf(string null);
else printf(string not null);
}
what is output of the program?

a) string is null
b) string is not null
c) error in program
d) it executes but print nothing

Q8.
# define f(a,b) a+b
#defiune g(c,d) c*d

Find  the value of f(4,g(5,6)).

a) 26
b) 51
c) 58
d) 65

Q9. The fastest memory is

a) DRAM
b) ROM
c) SRAM
d) Main memory

ANS: c) SRAM

Q10. What is the output of the following program?

void fn(int *p)
{
static int val = 100;
p = &val;
}
main()
{
int i=10;
printf(i=%d , i);
fn(&i);
printf(i=%d , i);
}

ANS: i=10 i=10

Q11. Global variable conflicts due to multiple file occurrence is resolved during

a) compile-time
b) run-time

Q12. If a 5-stage pipe-line is flushed and then we have to execute 5 and 12 instructions respectively then number of cycles will be

a) 5 and 12
b) 6 and 13
c) 9 and 16
d) none

Q13. Code 1 :

for(i=0; i<1000; i++)
for(j=0; j<100; j++)
x = y;

Code 2 :

for(i=0; i<100; i++)
for(j=0; j<1000; j++)
x = y;

Which code will execute faster?

a) Code 1 and Code 2 are of same speed
b) Code 1
c) Code 2
d) None.

ANS: Code 2

Q14.  In C, which parameter passing technique is used?

a) call by value,
b) call by reference,
c) both

ANS: a) call by value

Q15. What is the output of the following program?

# define MAX(a, b) a>b ? a:b
main()
{
int m, n;
m = 3 + MAX(2, 3);
n = 2 * MAX(3, 2);
printf(m = %d, n = %d , m, n)
}

ANS: m=2, n=3

Q16. Global variables in different files are at

a) compile time
d) execution time

Q17. Data structure used for priority queue

c) array
d) tree

Q18. CHAR A[10][15] and INT B[10][15] is defined. What is the address of A[3][4] and B[3][4], if address of  A IS OX1000 and B IS 0X2000?

a) 0X1030 and 0X20C3
b) OX1031 and OX20C4

Q19.  How many times the printf will be executed in the following program?

main()
{
int i;
fork();
fork();
fork();
printf(----);
}

a) 3
b) 6
c) 5
d) 8

Q20. What is the value of m?

#define f(a,b) a+b
#define g(a,b) a*b
main()
{
int m;
m=2*f(3,g(4,5));
printf( m is %d,m);
}

a) 70
b) 50
c) 26
d) 69

Q21. For hashing, which is best on terms of buckets?

a) 100
b) 50
c) 21
d) 32

ANS: 32

Q22. Compute the complexity of Binary search.

ANS: O(log n)

Q23. An array is stored in row major order. The memory capacity is 30 MB. And in unix system demand paging is used. Which one will give more page faults?

#define V_L_I 10000
int i, j, array[V_L_I][V_L_I];

Code 1 :
array[i][j] = 1;

Code 2 :
for(j=0; j
for(i=0; i
array[i][j] = 1;

ANS: Code 2

Q24. What is the output of the following program?

main()
{
int a[10] = {1, 2, 3, ...., 10}, i, x=10, temp;
for(i=0; i
temp = a[i];
a[i] = a[x-i-1];
a[x-i-1] = temp;
}

a) All contents of array a are reversed
b) Only some portions are altered
c) Remains same
d) None

ANS: c

Q25.
int a[10[15];
char b[10[15];

(a) location g a[3][4], if base location g a[0][0] is ox1000
(b) location g b[3][4], if base location g b[0][0] is ox2000
int taken 32 bits and char taken 8 bits.

ANS: (a) ox10C4 (b) ox2031

Q26. What is the output of the following program?

main()
{
unsigned char i;
int sum;
for(i=0; i<300; i++)
sum+ = i;
printf( Sum = %d , sum);
}

ANS: infinite loop

Q27. Programming exceptions are

a) Asynchronous
b) Synchronous
c) None

ANS: a) Asynchronous

Q28.  In DSP, which architecture is used?

a) MIMD
b) SIMD
c) Nueman
d) Harvard Architecture

ANS: d) Harvard Architecture

Q29. Which one will over flow given two programs

2 prog 1: prog2:
main() main()
{ {
int fact; int fact=0
long int x; for(i=1;i<=n;i++)
fact=factoral(x); fact=fact*i;
} }
int factorial(long int x)
{
if(x>1) return(x*factorial(x-1);
}

a) program 1
b) program 2
c) both 1 &2
d) none

Q30.
void f(int value){
for (i=0;i<16;i++){
if(value &0x8000>>1) printf(1)
else printf(0);
}
}
what is printed?

a) binary value of argument
b) bcd value
c) hex value
d) octal value

Q31. Find average access time of cache.

a) tc*h+(1-h)*tm
b) tcH+tmH
c) tc is time to access cache tm is time to access when miss occur.

Q32.
void f(int *p){
static val=100;
val=&p;
}
main(){
int a=10;
printf(%d ,a);
f(&a);
printf(%d ,a);
}
what will be output?

Q33.
struck a{
int x;
float y;
char c[10];
}
union b{
int x;
float y;
char c[10];
}
which is true?

Q34. What is the output of the program?

main()
{
char a[10]=hello;
strcpy(a,);
printf(%s,a);
}

a) string is null
b) string is not null
c) program error

Q35. What is the output of the following program?

define SUM(a,b) a+b
main()
a=2;
b=3;
x=SUM(a,b)*2;
printf(x=%d ,x);
}

ANS: 8.

Q36. What is the output of the following program?

number(int i)
{
number++;
printf(%d ,number);
}
main()
{
static int i=0;
number(i);
}

Q37.
main()
{
char a[10];
strcpy(a,);
if (a==NULL)
printf(a is null);
else
printf( a is not null);}

What happens with it?

a) compile time error.
b) run-time error.
c) a is null
d) a is not null.

Q38. Solve the k-map:

ab
----------
c 1 x 0 0
1 x 0 x

a) A.B
b) ~A
c) ~B
d) A+B

Q39.
int f(int *a)
{
int b=5;
a=&b;
}

main()
{
int i;
printf( %d,i);
f(&i);
printf( %d,i);
}
what is the output?

a) 10,5
b)10,10
c) 5,5
d) none

Q40. Local variables can be store by compiler

a) in register or heap
b) in register or stack
c) in stack or heap .
d) global memory.

Q41.
void f(int i)
{
int j;
for (j=0;j<16;j++)
{
if (i & (0x8000>>j))
printf(1);
else
printf(0);
}
}
What is the purpose of the program?

a) its output is hex representation of i
b) bcd
c) binary
d) decimal

Q42. Fastest IPC mechanism is

a) shared memory
b) pipes
c) named pipes
d) semaphores

ANS: c

Q43. 3 flip flops are connected so that after 0 to 5 count occured next number is zero. So what is the counter?

ANS: mod 6 counter

Q44. A 2*1 MUX is given. The inputs are A,B. Output is C. C and A are tied together. What is the name of the circuit?

ANS: Latch.

Q45. Simplify the Boolean Expression: A+AB.

ANS: A+B

Q46. 1-way set associative memory is called-----

a) direct
b) something
c) 1-way set associative
4) something

ANS: c

Q47. In a circuit, there are 3 resistors, 3 capacitors & one inverter. What is the value of the frequency such that the circuit oscillates?

a) f=RC
b) f=sqrt(3)/(Pi*R*C)
c) f=1/(Pi*R*C)
d) something

IBM
Samsung
Siemens
Philips