Initial commit
This commit is contained in:
36
3.3-BinaryOP/3.3-BinaryOP.csproj
Normal file
36
3.3-BinaryOP/3.3-BinaryOP.csproj
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<ProjectGuid>{7F3039D2-4B6D-45E3-9C96-6A3101D32982}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>BinaryOP</RootNamespace>
|
||||
<AssemblyName>3.3-BinaryOP</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Compile Include="BinaryOP.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
17
3.3-BinaryOP/3.3-BinaryOP.sln
Normal file
17
3.3-BinaryOP/3.3-BinaryOP.sln
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "3.3-BinaryOP", "3.3-BinaryOP.csproj", "{7F3039D2-4B6D-45E3-9C96-6A3101D32982}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7F3039D2-4B6D-45E3-9C96-6A3101D32982}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{7F3039D2-4B6D-45E3-9C96-6A3101D32982}.Debug|x86.Build.0 = Debug|x86
|
||||
{7F3039D2-4B6D-45E3-9C96-6A3101D32982}.Release|x86.ActiveCfg = Release|x86
|
||||
{7F3039D2-4B6D-45E3-9C96-6A3101D32982}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
12
3.3-BinaryOP/3.3-BinaryOP.userprefs
Normal file
12
3.3-BinaryOP/3.3-BinaryOP.userprefs
Normal file
@@ -0,0 +1,12 @@
|
||||
<Properties StartupItem="3.3-BinaryOP.csproj">
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="BinaryOP.cs">
|
||||
<Files>
|
||||
<File FileName="BinaryOP.cs" Line="16" Column="43" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore />
|
||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||
</Properties>
|
||||
25
3.3-BinaryOP/BinaryOP.cs
Normal file
25
3.3-BinaryOP/BinaryOP.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
class BinaryOP {
|
||||
static void printBinary(byte tal) {
|
||||
Console.WriteLine("Talet: 0x{0}", Convert.ToString(tal, 2).PadLeft(8, '0'));
|
||||
}
|
||||
|
||||
public static void Main() {
|
||||
byte tal = 54; // 0011 0110 = 54
|
||||
byte a = 3; // 0000 0011 = 3
|
||||
byte b = 5; // 0000 0101 = 5
|
||||
|
||||
printBinary(tal);
|
||||
|
||||
Console.WriteLine(a | b); // 0000 0111 = 7
|
||||
Console.WriteLine(a & b); // 0000 0001 = 1
|
||||
Console.WriteLine(a ^ b); // 0000 0110 = 6
|
||||
Console.WriteLine(~a & b); // 0000 0100 = 4
|
||||
Console.WriteLine(a << 1); // 0000 0110 = 6
|
||||
Console.WriteLine(a << 2); // 0000 1100 = 12
|
||||
Console.WriteLine(a >> 1); // 0000 0001 = 1
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
BIN
3.3-BinaryOP/bin/Debug/3.3-BinaryOP.exe
Normal file
BIN
3.3-BinaryOP/bin/Debug/3.3-BinaryOP.exe
Normal file
Binary file not shown.
BIN
3.3-BinaryOP/bin/Debug/3.3-BinaryOP.pdb
Normal file
BIN
3.3-BinaryOP/bin/Debug/3.3-BinaryOP.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
C:\Users\Crille\CSharp\3.3-BinaryOP\bin\Debug\3.3-BinaryOP.exe
|
||||
C:\Users\Crille\CSharp\3.3-BinaryOP\bin\Debug\3.3-BinaryOP.pdb
|
||||
C:\Users\Crille\CSharp\3.3-BinaryOP\obj\x86\Debug\3.3-BinaryOP.csprojResolveAssemblyReference.cache
|
||||
C:\Users\Crille\CSharp\3.3-BinaryOP\obj\x86\Debug\3.3-BinaryOP.exe
|
||||
C:\Users\Crille\CSharp\3.3-BinaryOP\obj\x86\Debug\3.3-BinaryOP.pdb
|
||||
Binary file not shown.
BIN
3.3-BinaryOP/obj/x86/Debug/3.3-BinaryOP.exe
Normal file
BIN
3.3-BinaryOP/obj/x86/Debug/3.3-BinaryOP.exe
Normal file
Binary file not shown.
BIN
3.3-BinaryOP/obj/x86/Debug/3.3-BinaryOP.pdb
Normal file
BIN
3.3-BinaryOP/obj/x86/Debug/3.3-BinaryOP.pdb
Normal file
Binary file not shown.
Reference in New Issue
Block a user