All files / src/comb mux.ts

33.33% Statements 3/9
0% Branches 0/4
0% Functions 0/5
25% Lines 2/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 288x                                                     8x
import {stde} from '../stde';
 
class Mux extends stde {
    constructor(in_count: number, preffix_address?: string, preffix_digital?: string) {
        let ind_count = in_count^2;
        super(
            'MUX',
            [
                ...Array.from({length: in_count}, (_, index) =>
                    preffix_address ? preffix_address : 'A_' + String(index + 1)
                ),
                ...Array.from({length: ind_count}, (_, index) =>
                    preffix_digital ? preffix_digital : 'D_' + String(index + 1)
                )
            ],
            ['out_1'],
            (a) => {
                return a;
            }
        );
    }
}
 
function mux(in_count: number, preffix_address?: string, preffix_digital?: string) {
    return new Mux(in_count, preffix_address, preffix_digital);
}
 
export {Mux, mux};