C questions for a hardware engineer

  1. What are the total number of lines written in C/C++? What is the most complicated/valuable program written in C/C++?
  2. What compiler was used?
  3. Have you studied buses? What types?
  4. Have you studied pipelining? List the 5 stages of a 5 stage pipeline. Assuming 1 clock per stage, what is the latency of an instruction in a 5 stage machine? What is the throughput of this machine ?
  5. How many bit combinations are there in a byte?
  6. What is the difference between = and == in C?
  7. Are you familiar with VHDL and/or Verilog?
This entry was posted in C++, Hardware. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

12 Comments on C questions for a hardware engineer

  1. bhaskar Krishna
    Posted 4/10/2006 at 6:09 am | Permalink

    What is the difference between = and == in C?

    = is an assignment operator

    a=b; //b’s value is stored in a

    if( a==b) // a’s value is compared with b

  2. ganesh
    Posted 4/26/2006 at 12:37 am | Permalink

    What are the total number of lines written in C/C++? What is the most complicated/valuable program written in C/C++?

  3. veeru
    Posted 5/15/2006 at 6:02 am | Permalink

    How many bit combinations are there in a byte?
    128 combinations from
    8′h00
    8′hff

  4. prasad
    Posted 10/27/2006 at 9:40 am | Permalink

    Have you studied buses? What types?

  5. xyz
    Posted 11/9/2006 at 5:14 pm | Permalink

    Have you studied pipelining? List the 5 stages of a 5 stage pipeline. Assuming 1 clock per stage, what is the latency of an instruction in a 5 stage machine? What is the throughput of this machine ?

    Ans.
    A sample microprocessor pipeline has following five stages.
    Instr Fetch-> Decode -> Execute -> Memory-> Write Back
    Throughput =1 inst/clock
    Latency =5 clocks.

  6. bhaskar krishna
    Posted 11/10/2006 at 5:35 am | Permalink

    Have you studied buses? What types?

    Bus Types

    The expansion bus (where expansion cards go) is an extension of the Central Processor, so when adding cards to it, you are extending the capabilities of the CPU itself. The relevance of this regard to the BIOS is that older cards are less able to cope with modern buses running at higher speeds than the original design of 8 or so MHz. Also, when the bus is accessed, the whole computer slows down to the bus speed, so it’s often worth altering the speed of the bus or the wait states between it and the CPU to speed things up.

    The PC actually has four buses;

    -> the processor bus connects the CPU to its support chips,
    -> the memory bus connects it to its memory,
    -> the address bus is part of both of them, and
    -> the I/O (or expansion) bus is what concerns us here(carries input and output).

  7. mhz
    Posted 4/9/2007 at 3:50 pm | Permalink

    How many bit combinations are there in a byte?

    If there are 8 bits in a byte, then the total number of combinations should be 2^8 = 256 no?

  8. Dos
    Posted 4/19/2007 at 7:16 pm | Permalink

    dude, why would there be 256 combinations? hahahaha

    But you are right about the 8 bits in a byte, but the 8th bit is 128.

    So that means that ninth bit is 256, meaning there is a cumlative combination of the 9th bit -1 as being the combination in 8 bits.

    -Dos

  9. Dos
    Posted 4/19/2007 at 11:32 pm | Permalink

    So 255 is the answer, if you didn’t get what I was saying.

    -Dos

  10. John Pfaff
    Posted 4/21/2007 at 8:21 am | Permalink

    No, there are 256 combinations, 0 through 255 (or 0×00 through 0xFF). 0 is a valid value.
    So the answer is 256.

  11. shekar_kcb
    Posted 10/30/2007 at 8:06 am | Permalink

    The difference btw = and == is :
    in code if you type ,
    a=5; /* means the value 5 will be assigned to 5 therfore = is an assignment */
    /* operator*/

    if(a==5) /* here == is used to compare , in otherwords == is used only to */
    /* compare the values here 5 is not assigned to a , but it checks */
    /* the value of a with 5 if true then proceeds with the loops*/

  12. naim shaikh
    Posted 11/24/2007 at 10:26 am | Permalink

    What is the code for reading “boot sector” in C ?

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*