Skip to main content
LibreTexts - Ukrayinska

19.6: Вправи з програмування

  • Page ID
    64346
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)

    1

    Булева функція або функція перемикання\(n\) змінних - це карта\(f : \{O, I\}^n \rightarrow \{ 0, I\}\text{.}\) Булевий поліном - це особливий тип булевої функції: це будь-який тип булевого виразу, утворений з кінцевої комбінації4n змінних\(x_1, \ldots, x_n\) разом з \(O\)і\(I\text{,}\) за допомогою операцій\(\vee\text{,}\)\(\wedge\text{,}\) і\('\text{.}\) Значення функцій визначені в табл\(19.33\). Напишіть програму для обчислення булевих поліномів.

    \(Table \text { } 19.33.\)Булеві многочлени

    \(x\) \(y\) \(x'\) \(x \vee y\) \(x \wedge y\)
    \(0\) \(0\) \(1\) \(0\) \(0\)
    \(0\) \(1\) \(1\) \(1\) \(0\)
    \(1\) \(0\) \(0\) \(1\) \(0\)
    \(1\) \(1\) \(0\) \(1\) \(1\)