promotion image of download ymail app
Promoted
匿名使用者
匿名使用者 發問時間: 電腦與網際網路程式設計 · 5 年前

[緊急]面試考題求解II

考題如下,解答最多的拿點數,感謝!

1. Write a C code:

a) Int Get_Bit7_of_Input(int in)//return the bit content form

b) void Set_Bit5_of_Input(int *in) //set the 5th bit of input

c) void Clear_Bit_of_Input(int *in, int bit) //clea the specific bit of input

2. Explain the purpose of the keywords "static" and "volatile."

3. List memory type based on speed, from fast to slow.

4. Explain D-Cache & I-Cache and list their limitation.

5. Explain the meaning and the usage of DMA.

6. How to design/plain/calculate "heap" and "stack" in an embedded system?

If there are three processes in this system, does each process has its own stack?

how many stacks in this system?

7. List interrupt types (level trigger vs. edge trigger) . Explain IRQ.

8. Explain .text, .rodata, .data, .bss section.

which sections does the following variables belong to?

int a = 2; int b=0; int c;

9. Compare semaphore and mutex.

10. Compare repeater, hub, switch, router, bridge

11. Explain telecom & datacom. Which part does VoIP belong to?

12. Explain the behavior of ARP. In what situation, we do not need ARP?

13. Describe the functionalities of WiFi and Bluetooth.

14. How to design a power-saving sysytem.

15. How to design a preemptive kernel?

16. Explain ABI (Application Binary Interface)

17. Do we need a tick timer in an embedded system? why?

18. Explain the usage and the important things that you are using macro and #include

19. How to implement a printf function in multi-task system without printing out disordered message

20. How to design a debug mechanism in an embedded system?

21. How to design source level debugging?

22. Explain LMA and VMA.

23. Explain the difference between Firmware memory requirement and firmware image size. How to reduce the image size?

1 個解答

評分
  • 5 年前
    最佳解答

    #include <stdlib.h>

    #include <stdio.h>

    int Get_Bit7_of_Input(int in) {

    //return the bit content form

    int result = 0, m = 1;

    while(in > 0) {

    result += (in % 2) * m;

    in /= 2;

    m *= 10;

    }

    return result;

    }

    void Set_Bit5_of_Input(int *in) {

    //set the 5th bit of input

    *in = *in | 32;

    }

    void Clear_Bit_of_Input(int *in, int bit) {

    //clea the specific bit of input

    int i, two = 1;

    for(i = 1; i <= bit; i++) {

    two *= 2;

    }

    if((*in & two) == two)

    *in = *in ^ two;

    }

    • Commenter avatar登入以對解答發表意見
還有問題?馬上發問,尋求解答。