北美ASIC经典面试试题

question:
come up with logic that counts number of ‘1’s in a 7 bit wide vector.you can only use combinational logic.
answer:
following is one of the ways to come up with such logic.
input vector is 7 bit wide. to sum up 7 bits we need 3 bits of binary encoded output.we’ve full adders available. a single full adder can add 3 input bits and generate 2 bitsof binary encoded output.e.g. a full adder can add 3 bit wide input vector ‘111’ and generate ‘11’ output.we can pick two full adders and add up 6 bits of the input vector and will end up withtwo sets of two bit wide binary encoded data.e.g. if input vector is ‘1100111’, we can assume two full adders adding up first 6bits ‘110011’ where first three bits ‘110’ are input to first adder and ‘011’ are inputto second adder. first adder will output ‘10’ (decimal 2) and second adder will alsooutput ‘10’ (decimal 2), and we need to add up two two bit binary vectors. we canagain employ full adders to do this as we still have to account for the 7th input bit ofthe input vector. that can go into the least significant full adder carry-input.
for the above example :
input vector ‘1100111’
input ‘110’ => full adder => ‘10’ output
input ‘011’ => full adder => ‘10’ output
10
+10
------
100 => output (4)
now accounting for the seventh input bit ‘1’ as carry into the least significant adder.
1 binary encoded decimal 5 which is the input of 1s in inputvector ‘1100111’.
full adders can be used to add-up 3 input bits at a time. outputs of first level of fulladders represent the two bit encoded version of the total ‘1’s count, which we need toadd up get the final two digit encoded version of total ‘1’s. since we need to add up7 bit inputvector, 7th input vector can be used as ‘carry in’ in the second level of fulladders.

光学雨量计工作原理和优缺点是什么?
日本首次 SkyDrive载人多旋翼机试飞完成
FreeRTOS信号量介绍
雷神发布了911黑武士Ⅱ台式电脑
苹果Apple Watch又救人一命 摔倒检测功能立功!
北美ASIC经典面试试题
手机射频增强技术通信解决方案
静电监控在半导体行业中的应用
你不知道的TDK EMC滤波器的作用: LeaXield最小化漏地电流
360N5和乐Pro3双摄AI版哪个好?这些区别你都知道吗?
RT-Thread商业网站发布,将以自主操作系统及核心软件技术服务于行业
为什么海尔成为物联网的“路标”?
士兰微电子上榜2023中国最具投资价值车规级芯片企业榜单
TikTok出售有关美国/加拿大/澳大利亚/新西兰业务的交易协议
刘作虎发内部信:一加要明年力争中国线上高端第一
高新兴物联电力物联网通信产品不断探索创新
动力电池行业洗牌进入倒计时,2018补贴再承压
为什么说RPA是实现AI的第一步
质量流量计是动态计量的一种重要手段,它的优点是什么
NPN型三极管和PNP型三极管的工作原理