السلام عليكم
هذا كود 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);}