编程介的小学生 2019-11-16 22:37 采纳率: 20.5%
浏览 133

74LS00 正确的解法

Problem Description
It’s known to us that 74LS00 is a useful digital logic chip for use in a variety of projects. Give you the voltage in all the pins. Your task is quite simple, just estimate whether the chip could work normally or not.
Here are some essential hints about the pins:

Note: If you chose Pins (1, 2) for input, only Pins (3) would indicate logic.

Here follow the definition of “logic”
If voltage Vi, |Vi-5|<=0.5 then we call it a “High Logic”
If voltage Vi is no larger than 0.8V, and Vi>=0 then we call it a “Low Logic”

“H”: High Logical
“L”: Low Logical
That is to say, if the voltage in Pin 1 is 5.0V and the voltage in Pin 2 is 5.0V, so the Pin 3 indicates Low Logic.
The voltage in Pin 14 must be exactly 5.0V so that the chip could work normally; the voltage in Pin 7 must be always Low Logic.

Input
The input consists of several test cases.
In the first line there is an integer n (2<=n<=10), indicating the number of descriptions.
The next n lines contain the descriptions of the different Pins
All the descriptions are given in the following format
Pin_ID Voltage
We guarantee that the Voltage is always in the range. (0<=Voltage<=0.8 or 4.5<=Voltage<=5.5)
We guarantee that Pin 14 and Pin 7 will always be given in every case.

Output
For each test case, if the chip could work normally, just output “Yes”, else output ”No” (without the quotations)
If the chip could work normally, please output the logic in the “Output Pins” if there exist some.
The format for output the “Output Pins” is:
Pin_ID Logic
Here Logic is either ‘H’ or ‘L’ as it described above.
Hint: You should output the “Output Pins” in ascending order in Pin_ID.

Sample Input
2
14 5.00000000
7 0.1
2
14 5.1
7 0.8
4
14 5.0000
7 0.7
1 0.3766
2 5.1344
6
14 5.00000000000
7 0
1 5.1
2 5.1
4 5.1
5 5.1

Sample Output
Yes
No
Yes
3 H
Yes
3 L
6 L

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料