الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كود MUX_8x1/Dcoder_3x8

بدأه a.s.a في 17 يونيو 2013 · 1 رد · 1,246 مشاهدة · في مشاريع ومسابقات القسم
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

 

 

هذا كود MUX_8x1  

 

كان عندي وظيفة في التعليم وحليته وحبيت انزلة للفائده

#include<stdio.h>void main() { int arr_input[8];  int arr_strobe[3];  int i; int decide, output; printf("Enter 8 mux inputs (from high to low) : "); for(i=0;  i<8;  i++)	scanf("%d", &arr_input); printf("Enter 3 select inputs (from high to low) : "); for(i=0;  i<3;  i++)	scanf("%d", &arr_strobe); //index of arr goes from left to right //index of bits in binary number goes from right to left!!  decide =  arr_strobe[0]*4 + arr_strobe[1]*2 + arr_strobe[2]*1; output=arr_input[7-decide]; //value printf("Input %d of MUX is selected as output\n", decide); printf("Output is : %d\n\n", output);}
#2

السلام عليكم  هذا

 

كود  Dcoder_3x8

 

اتمنى ان يفيدكم 

#include<stdio.h>void main(){ int arr_input[3] ; int arr_output[8]={0,0,0,0,0,0,0,0};  int  i, decide; printf("Enter decoder inputs (from high to low) : "); for(i=0;  i<3;  i++)	scanf("%d", &arr_input); // index of arr goes from left to right // index of bits in binary number goes from right to left !! decide = arr_input [0]*4 + arr_input [1]*2 + arr_input [2]*1; printf("\nOutput D%d of Decoder is selected!\n", decide); arr_output[7-decide] = 1;  //put value to array printf("\nOutputs of decoder are: (from low to high)\n"); for(i=7;  i>=0;  i--)	printf("D%d = %d \n", 7-i, arr_output);}

مواضيع مشابهة